aboutsummaryrefslogtreecommitdiff
path: root/nerv/examples/lmptb/lmptb/lmutil.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/examples/lmptb/lmptb/lmutil.lua')
-rw-r--r--nerv/examples/lmptb/lmptb/lmutil.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/nerv/examples/lmptb/lmptb/lmutil.lua b/nerv/examples/lmptb/lmptb/lmutil.lua
index 77babef..821aa94 100644
--- a/nerv/examples/lmptb/lmptb/lmutil.lua
+++ b/nerv/examples/lmptb/lmptb/lmutil.lua
@@ -124,7 +124,7 @@ function Timer:__init()
end
function Timer:tic(item)
- self.last[item] = os.time()
+ self.last[item] = os.clock()
end
function Timer:toc(item)
@@ -134,11 +134,11 @@ function Timer:toc(item)
if (self.rec[item] == nil) then
self.rec[item] = 0
end
- self.rec[item] = self.rec[item] + os.difftime(os.time(), self.last[item])
+ self.rec[item] = self.rec[item] + os.clock() - self.last[item]
end
function Timer:flush()
for key, value in pairs(self.rec) do
- self.rec[key] = 0
+ self.rec[key] = nil
end
end