lama_byterun/stdlib/Timer.lama
2020-08-02 23:56:21 +03:00

14 lines
350 B
Text

-- Timer.
-- (C) Dmitry Boulytchev, JetBrains Research, St. Petersburg State University, 2020
--
-- This unit provides an implementation for simple timer. A timer is a function which
-- measures an elapsed time (in microseconds) since its creation.
-- Creates a new timer
public fun timer () {
local t = time ();
fun () {
time () - t
}
}