![]() |
|
Timer/Time milliseconds? |
CRAZY CONDITIONS
Member #16,385
June 2016
![]() |
When writing an Allegro program for Android, what time unit is used by al_create_timer() and al_get_time()?
|
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Generally you get millisecond accuracy. It is controlled by the system timer. How accurate do you need it to be? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
CRAZY CONDITIONS
Member #16,385
June 2016
![]() |
I don't understand this in the API reference: al_get_time: Return the number of seconds since the Allegro library was initialised. The return value is undefined if Allegro is uninitialised. The resolution depends on the used driver, but typically can be in the order of microseconds. What is the Resolution? The time unit is ALWAYS seconds?
|
Audric
Member #907
January 2001
|
It is expressed in seconds. 1 is one second, 0.5 is 500 milliseconds. You can type 1.0/60.0 when you want to express 1/60th of a second (Not the same as 1/60 !). The resolution is the 'level of detail' of the returned number. If I understand correctly, it means you typically obtain a number such as 0.12345600000000000 (The last 6 is microseconds) The docs say 'typically' because the same documentation applies to many operating systems where Allegro is implemented. If one OS/driver has worse precision, the relevant API may only produce numbers with zeroes under milliseconds (0.123000000000) |
|