diff options
| author | unwox <me@unwox.com> | 2024-10-17 14:33:26 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-10-17 14:33:26 +0600 |
| commit | 56435ab386709e959f1f666354a48e87540cae9d (patch) | |
| tree | aaf25e73d5421fb3d87e1d49a1e5c51daf08918b /lib | |
| parent | 512cc8942f944533775adf0a84c1d4b9b31e45bc (diff) | |
measure execution time in nanoseconds
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils.fnl | 4 |
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} |
