mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-05 23:10:58 +00:00
Don't assume evdev events and SDL_GetTicks() use the same time source
The evdev events are in the same time base as gettimeofday(), but SDL_GetTicks() might be using clock_gettime()
This commit is contained in:
parent
57d34f2e10
commit
75f1eb9216
3 changed files with 10 additions and 20 deletions
|
@ -565,22 +565,6 @@ void SDL_TicksQuit(void)
|
|||
tick_start = 0;
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDL_GetTickStartNS(void)
|
||||
{
|
||||
Uint64 starting_value, value;
|
||||
|
||||
if (!tick_start) {
|
||||
SDL_TicksInit();
|
||||
}
|
||||
|
||||
starting_value = tick_start;
|
||||
value = (starting_value * tick_numerator_ns);
|
||||
SDL_assert(value >= starting_value);
|
||||
value /= tick_denominator_ns;
|
||||
return value;
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDL_GetTicksNS(void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue