gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Hardware > Timer register?

#5442 - bakery2k - Sun Apr 27, 2003 9:32 pm

Does the GBA have a register I can read to get a reasonably accurate timer? Something like timeGetTime on Win32?
If not, is there another way of implementing this?

#5444 - tepples - Sun Apr 27, 2003 10:47 pm

bakery2k wrote:
Does the GBA have a register I can read to get a reasonably accurate timer?

Yes. If you want to time an event down to cycle accuracy, look at these registers. But if you just want to time events in your game, it's best to keep your own timer as a global variable and increment it on vblank.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.