cpptimer - Millisecs and Delay (stdcpp, GLFW)

Monkey Forums/User Modules/cpptimer - Millisecs and Delay (stdcpp, GLFW)

outsider(Posted 2012) [#1]
(double post)


outsider(Posted 2012) [#2]
Hi, this is small module with two functions for stdcpp (also GLFW).
Built on a high resolution timer by Song Ho Ahn (http://www.songho.ca/misc/timer/timer.html)

Millisecs:Float()
Delay:Void(millisecs:int)


Example of use:
[monkeycode]Strict
Import cpptimer

Function Main:Int()
Local time:Float

time = Millisecs()
Delay(1000)
time = Millisecs()
Print(time)

Delay(1500)
time = Millisecs()
Print(time)

Delay(1671)
time = Millisecs()
Print(time)

Return 0
End[/monkeycode]

Download


Shinkiro1(Posted 2012) [#3]
Hey, nice one. It would be great to also get a high resolution timer for ios/android.


outsider(Posted 2012) [#4]
Well, mojo has Millisecs() function, I created this because there is no mojo for stdcpp. Do not know if ios/android have a high resolution timer, but it should have Millisecs() function.