SetUpdateRate / GetUpdateRate

Monkey Forums/Monkey Programming/SetUpdateRate / GetUpdateRate

Playniax(Posted 2011) [#1]
I could really need something like GetUpdateRate for SetUpdateRate

Or is there another way that I missed?


Richard Betson(Posted 2011) [#2]
This what I use to measure frames per-second.

	'Count FPS
	fps=fps+1
	If fps_t<Millisecs()
		fp=(fps)-1
		fps_t=1000+Millisecs()
		fps=0
	Endif

	DrawText(fp,0,0)




Playniax(Posted 2011) [#3]
Yes, ofcourse. Thanks!

But I meant a function to get the update rate previously set with Monkeys own SetUpdateRate ()


Perturbatio(Posted 2011) [#4]
Well, the default is 60, so unless you change it, it'll stay that way. Couldn't you just store that in a var?

*EDIT*
Scrap that, just realised it's for your framework.


Playniax(Posted 2011) [#5]
No problem. Yes it's for the framework. Of course I can put in in a var but I guess it would be nice to have a GetUpdateRate ()


therevills(Posted 2011) [#6]
Ive added this to Diddy via native calls, if you want to have a look:

http://code.google.com/p/diddy/source/browse/#svn%2Ftrunk%2Fsrc%2Fdiddy%2Fnative

(iOS not tested...)

Just wondering what you are going to use it for? Debug info?


Playniax(Posted 2011) [#7]
Need it to calculate timing tweening/fixed rate stuff.


skid(Posted 2011) [#8]
Well, the default is 60, so unless you change it, it'll stay that way.


That is simply untrue.


Playniax(Posted 2011) [#9]
yep, and if you change it to let's say 30 it would be nice to read that.


Perturbatio(Posted 2011) [#10]

That is simply untrue.

You're right, sorry. Don't know why I thought that.


Playniax(Posted 2011) [#11]
We all make mistakes;)


therevills(Posted 2011) [#12]
@Playniax - Did you see that we have added this to Diddy? You can take the code and add it to your project if you want.


Playniax(Posted 2011) [#13]
@therevills - I had a quick look. maybe I will. Thanks!