Commit 5c4c1c5b authored by Benjamin Summerton's avatar Benjamin Summerton

It compiles!

but "sleep()" isn't working
parent 437432d1
......@@ -2,18 +2,19 @@ include system/timers
type
Stopwatch* = ref object
running*: bool
start*: Nanos
stop*: Nanos
Stopwatch* = object
running: bool
start: Nanos
stop: Nanos
# TODO document
proc newStopwatch*(): Stopwatch =
new(result)
result.running = false
result.start = 0
result.stop = 0
result = Stopwatch(
running: false,
start: 0,
stop: 0
)
# TODO clone/copy constructor
......
import stopwatch
from os import sleep
var sw: Stopwatch = newStopwatch()
#sw.start()
#sleep(1)
#sw.stop()
var sw = newStopwatch()
sw.start()
sleep(1)
sw.stop()
echo sw.secs
#echo sw.msecs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment