From 56435ab386709e959f1f666354a48e87540cae9d Mon Sep 17 00:00:00 2001 From: unwox Date: Thu, 17 Oct 2024 14:33:26 +0600 Subject: measure execution time in nanoseconds --- lib/utils.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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} -- cgit v1.2.3