mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999)
This commit is contained in:
@@ -56,11 +56,11 @@ 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")
|
||||
local logger = require("logger")
|
||||
local time = require("ui/time")
|
||||
local util = require("util")
|
||||
local _ = require("gettext")
|
||||
local Screen = require("device").screen
|
||||
@@ -290,19 +290,19 @@ function ReaderUI:init()
|
||||
end
|
||||
-- make sure we render document first before calling any callback
|
||||
self:registerPostInitCallback(function()
|
||||
local start_tv = TimeVal:now()
|
||||
local start_time = time.now()
|
||||
if not self.document:loadDocument() then
|
||||
self:dealWithLoadDocumentFailure()
|
||||
end
|
||||
logger.dbg(string.format(" loading took %.3f seconds", TimeVal:getDuration(start_tv)))
|
||||
logger.dbg(string.format(" loading took %.3f seconds", time.to_s(time.since(start_time))))
|
||||
|
||||
-- used to read additional settings after the document has been
|
||||
-- loaded (but not rendered yet)
|
||||
self:handleEvent(Event:new("PreRenderDocument", self.doc_settings))
|
||||
|
||||
start_tv = TimeVal:now()
|
||||
start_time = time.now()
|
||||
self.document:render()
|
||||
logger.dbg(string.format(" rendering took %.3f seconds", TimeVal:getDuration(start_tv)))
|
||||
logger.dbg(string.format(" rendering took %.3f seconds", time.to_s(time.since(start_time))))
|
||||
|
||||
-- Uncomment to output the built DOM (for debugging)
|
||||
-- logger.dbg(self.document:getHTMLFromXPointer(".0", 0x6830))
|
||||
|
||||
Reference in New Issue
Block a user