[SDL] SDL_GetTicks() goes backwards
David Olofson
david at olofson.net
Tue Dec 24 08:50:02 PST 2002
On Tuesday 24 December 2002 16.28, Joseph Carter wrote:
> On Tue, Dec 24, 2002 at 04:06:57PM +0100, Daniel Phillips wrote:
> > > We have similar code in Twilight, the clock itself on your
> > > system may be going backwards every now and then, not a hell of
> > > a lot SDL itself can do about it.
> >
> > In other words, it may be a kernel issue? (2.4.19) Well, if it
> > is, at least we need to assign blame. I should know for sure
> > some time today.
>
> In other words, blame ntp.
And if you *have* to use NTP...? (I use it. Tired of having 'make'
fail due to clocks out of sync... *heh*) I think this has to be dealt
with at some level.
What I'm saying is basically: Who says time cannot go backwards? The
application? SDL? gettimeofday()?
If there's an API that guarantees that time will not go backwards,
it's implementation(s) should also make sure you can actually trust
the API spec.
The SDL 1.2.5 man files don't say anything about this, so I'm
wondering whether you should really assume that SDL_GetTicks won't
move backwards... I think not.
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`---------------------------> http://olofson.net/audiality -'
--- http://olofson.net --- http://www.reologica.se ---
More information about the SDL
mailing list