summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-10-17 14:33:26 +0600
committerunwox <me@unwox.com>2024-10-17 14:33:26 +0600
commit56435ab386709e959f1f666354a48e87540cae9d (patch)
treeaaf25e73d5421fb3d87e1d49a1e5c51daf08918b /lib
parent512cc8942f944533775adf0a84c1d4b9b31e45bc (diff)
measure execution time in nanoseconds
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.fnl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils.fnl b/lib/utils.fnl
index 405bf72..917f4af 100644
--- a/lib/utils.fnl
+++ b/lib/utils.fnl
@@ -3,9 +3,9 @@
(if ok? result (error result)))
(fn measure [what f]
- (local start (luna.utf8.now))
+ (local start (must (luna.time.now)))
(local res (table.pack (f)))
- (print (.. what ": " (/ (- (luna.time.now) start) 1e6)))
+ (print (.. what ": " (/ (- (must (luna.time.now)) start) 1e6)))
(values (table.unpack res)))
{: must : measure}