|
Author |
Topic: millis() and draw()/loop() (Read 828 times) |
|
fry
|
Re: millis() and draw()/loop()
« Reply #16 on: Jul 25th, 2003, 2:55am » |
|
on Jul 17th, 2003, 8:20pm, toxi wrote:ben why can't we change the current millis() implentation to something like this: public int millis() { return (int) (System.currentTimeMillis() - millisOffset); } this will always return up-to-date values and keep all the other advantages you mentioned. no |
| yeah, though it's slow. you're calling out to a native function with currentTimeMillis, which returns 8 bytes (oog, that's bigger than our processors are happy with!) and then subtracting that from another stored 8 byte number, then casting it all down to an int. at least that was my initial impression. however, maybe in the basic case, this doesn't really matter--since we're either calling it once per loop, in which case it's fine, or getting the extra resolution, which is slower, but it works where it didn't before. errr.. if that makes sense. hm, just ate my once monthly pile of fried food and it seems to have constricted too many of the blood vessels leadin to me 'noggin.
|
|
|
|
fry
|
Re: millis() and draw()/loop()
« Reply #17 on: Jul 25th, 2003, 3:05am » |
|
okok, implemented for 57.
|
|
|
|
toxi
|
Re: millis() and draw()/loop()
« Reply #18 on: Jul 25th, 2003, 12:32pm » |
|
uncle fry, you da man! heck, i just realised the coincidence between your name and choice of food! but do we need your brains here, be careful!
|
http://toxi.co.uk/
|
|
|
|