mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Port ffiUtil.getTimestamp users to TimeVal:now()
They were all using it to compute durations, something which is going to be more sensible from a monotonic clock source.
This commit is contained in:
@@ -52,6 +52,7 @@ local ReaderWikipedia = require("apps/reader/modules/readerwikipedia")
|
||||
local ReaderZooming = require("apps/reader/modules/readerzooming")
|
||||
local Screenshoter = require("ui/widget/screenshoter")
|
||||
local SettingsMigration = require("ui/data/settings_migration")
|
||||
local TimeVal = require("ui/timeval")
|
||||
local UIManager = require("ui/uimanager")
|
||||
local ffiUtil = require("ffi/util")
|
||||
local lfs = require("libs/libkoreader-lfs")
|
||||
@@ -277,19 +278,19 @@ function ReaderUI:init()
|
||||
end
|
||||
-- make sure we render document first before calling any callback
|
||||
self:registerPostInitCallback(function()
|
||||
local start_ts = ffiUtil.getTimestamp()
|
||||
local start_tv = TimeVal:now()
|
||||
if not self.document:loadDocument() then
|
||||
self:dealWithLoadDocumentFailure()
|
||||
end
|
||||
logger.dbg(string.format(" loading took %.3f seconds", ffiUtil.getDuration(start_ts)))
|
||||
logger.dbg(string.format(" loading took %.3f seconds", TimeVal:getDuration(start_tv)))
|
||||
|
||||
-- used to read additional settings after the document has been
|
||||
-- loaded (but not rendered yet)
|
||||
self:handleEvent(Event:new("PreRenderDocument", self.doc_settings))
|
||||
|
||||
start_ts = ffiUtil.getTimestamp()
|
||||
start_tv = TimeVal:now()
|
||||
self.document:render()
|
||||
logger.dbg(string.format(" rendering took %.3f seconds", ffiUtil.getDuration(start_ts)))
|
||||
logger.dbg(string.format(" rendering took %.3f seconds", TimeVal:getDuration(start_tv)))
|
||||
|
||||
-- Uncomment to output the built DOM (for debugging)
|
||||
-- logger.dbg(self.document:getHTMLFromXPointer(".0", 0x6830))
|
||||
|
||||
Reference in New Issue
Block a user