Skip to content

Commit

Permalink
Restored floating point time granularity.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamharrison committed Jan 8, 2022
1 parent 93076bd commit 31d4489
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions data/core/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ function core.confirm_close_docs(docs, close_fn, ...)
end
end

local temp_uid = (system.get_time() * 1000) % 0xffffffff
local temp_file_prefix = string.format(".lite_temp_%08x", temp_uid)
local temp_uid = math.floor(system.get_time() * 1000) % 0xffffffff
local temp_file_prefix = string.format(".lite_temp_%08x", tonumber(temp_uid))
local temp_file_counter = 0

local function delete_temp_files()
Expand Down
2 changes: 1 addition & 1 deletion src/api/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ static int f_set_clipboard(lua_State *L) {

static int f_get_time(lua_State *L) {
double n = SDL_GetPerformanceCounter() / (double) SDL_GetPerformanceFrequency();
lua_pushinteger(L, n);
lua_pushnumber(L, n);
return 1;
}

Expand Down

0 comments on commit 31d4489

Please sign in to comment.