[feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999)

This commit is contained in:
zwim
2022-05-05 21:00:22 +02:00
committed by GitHub
parent 54ead5fc88
commit 9b9cfe29a4
44 changed files with 1009 additions and 497 deletions

View File

@@ -1,6 +1,6 @@
local logger = require("logger")
local TimeVal = require("ui/timeval")
local UIManager = require("ui/uimanager")
local time = require("ui/time")
local CommandRunner = {
pio = nil,
@@ -37,7 +37,7 @@ function CommandRunner:start(job)
assert(self.pio == nil)
assert(self.job == nil)
self.job = job
self.job.start_tv = UIManager:getTime()
self.job.start_time = UIManager:getTime()
assert(type(self.job.executable) == "string")
local command = self:createEnvironment() .. " " ..
"sh plugins/backgroundrunner.koplugin/luawrapper.sh " ..
@@ -77,7 +77,7 @@ function CommandRunner:poll()
UIManager:allowStandby()
self.pio:close()
self.pio = nil
self.job.end_tv = TimeVal:now()
self.job.end_time = time.now()
local job = self.job
self.job = nil
return job