mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 14:58:50 +00:00
15 lines
350 B
Text
15 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
|
||
|
|
}
|
||
|
|
}
|