summaryrefslogtreecommitdiff
path: root/lib/utils.fnl
blob: fcc235c7ffb7df4fab039e6246e857a1dcdec691 (plain)
1
2
3
4
5
6
7
8
9
10
11
(fn must [...]
  (local (ok? result) ...)
  (if ok? result (error result)))

(fn measure [what f]
  (local start (luna.utf8.now))
  (local res (table.pack (f)))
  (print (.. what ": " (/ (- (luna.utf8.now) start) 1e6)))
  (values (table.unpack res)))

{: must : measure}