High resolution timer

Monkey Forums/Monkey Programming/High resolution timer

Shinkiro1(Posted 2013) [#1]
Hi,

Before I do it myself I wanted to ask if somebody has implemented a cross target high-resolution timer?

I have a working version for html5, which works in chrome & firefox (safari has no performance object)
'js
getMicroseconds = function() {
	if (typeof window.performance === 'undefined') return -1;
	return window.performance.now() || -1;
}

'monkey
#If TARGET = "html5"
	Import "native.js"

	Extern
	Function GetMicroseconds:Float() = "getMicroseconds"
#End



dawlane(Posted 2013) [#2]
I think Goodlookingguy has some timer code for cross platform.
http://www.monkeycoder.co.nz/Community/post.php?topic=7561&post=73062


Shinkiro1(Posted 2013) [#3]
What I actually mean is a High-Resolution Timer, one that can give me Micro/Nano Seconds instead of Milliseconds().


Sammy(Posted 2014) [#4]
Shinkiro1 did you manage to find a solution to your problem?