Re: [AD] use double for al_current_time and al_rest? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] use double for al_current_time and al_rest?
- From: Elias Pschernig <elias@xxxxxxxxxx>
- Date: Sun, 20 Jan 2008 18:41:05 +0100
On Sat, 2007-12-29 at 23:34 +1100, Peter Wang wrote:
>
> That's horrible for multithreaded programs, unless the counter is
> thread-local. Even then, it's horrible as soon as you have two time
> intervals to track within the one OS thread. In any case, we use
> al_current_time() for the time stamp in events. We need a global
> reference for that.
Ok, if nobody complains, I'll just change all the time related "long"
into uint64_t, and change from milliseconds to nanoseconds.
Milliseconds are really not enough, e.g. when I do:
al_set_timer_speed(16)
I get a timer of 62.5 Hz, if I do:
al_set_timer_speed(17)
I get a timer of 58.8 Hz. This is ridiculous, Allegro 4 was able to give
me an exact 60 Hz timer, and even in DOS or on ancient machines like a
C-64 it was possible :P
Allegro 5 *at least* would need us, but as we already would need
uint64_t for that, best is ns. (Or double, which I would still prefer,
but apparently there is concern about diminishing accuracy after a few
1000 years of continuously running the program..)
--
Elias Pschernig <elias@xxxxxxxxxx>