love.timer.getTime unnecessary due to love.timer.getMicroTime

Issue #492 resolved
created an issue

Currently, it seems that love.timer.getTime is simply a less accurate version of love.timer.getMicroTime.

The wiki says that love.timer.getTime starts at an unspecified starting time. Checking the source, love.timer.getTime seems to wrap SDL_GetTicks converted to seconds, and it makes sense that this number wouldn't quite be equal to the time that the game has been running. So I can't see why anyone would want to use love.timer.getTime instead of love.timer.getMicroTime.

I propose that love.timer.getTime be removed, and maybe that love.timer.getMicroTime claims the name love.timer.getTime, although that name kind of implies it returns the current local time.

Comments (2)

  1. Boolsheet

    love.timer.getMicroTime uses non-monotonic timers on Linux and OS X. Things can go very wrong if the user or the NTP daemon/service changes the time. SDL_GetTicks gives us a stable and monotonic timer with millisecond resolution that should work the same on all platforms.

    Edit: Apparently SDL uses a non-monotonic timer for SDL_GetTicks on OS X. That's just great.

  2. Log in to comment