Millisecs in GLFW

Monkey Forums/Monkey Bug Reports/Millisecs in GLFW

slenkar(Posted 2012) [#1]

#MOJO_AUTO_SUSPEND_ENABLED=True

Import monkeytarget
Import mojo
Class bbgamething Extends App

Method OnCreate:Int()
SetUpdateRate 60
End
Method OnUpdate:Int()
Print "UpdateGame"
Local m:Int=Millisecs()
Print m
End

Method OnRender:Int()
Print "RenderGame"
End

End

Function Main()

New bbgamething()

End



In MingW GlFW the time seems to be the old method e.g. how many millisecs have elapsed since the game began

in HTML5 and Flash millisecs is a negative number , is this normal?


MikeHart(Posted 2012) [#2]
Which version of Monkey?


slenkar(Posted 2012) [#3]
67b on windows


therevills(Posted 2012) [#4]
In MingW GlFW the time seems to be the old method e.g. how many millisecs have elapsed since the game began

67b on windows


Are you sure... looking at the code for 67b, C++'s Millisec code is this:
int BBGame::Millisecs(){
	return 0;
}


[Edit]Ah because of the new target system its actually using this method:
int BBGlfwGame::Millisecs(){
	return glfwGetTime()*1000.0;
}


And glfwGetTime returns the number of seconds that has elapsed since glfwInit().

in HTML5 and Flash millisecs is a negative number , is this normal?

I guess its because Monkey doesnt have a long primitive, so yes it is normal.