Skip to content

Commit

Permalink
Merge pull request #302 from effekt-lang/fix/301-currentNanos
Browse files Browse the repository at this point in the history
fix currentTimeNanos to return nanos, not micros
  • Loading branch information
b-studios authored Nov 7, 2023
2 parents e8136ac + f675a13 commit a609028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/js/effekt.effekt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def repeat(n: Int) { action: () => Unit } = each(0, n) { n => action() }
// Current time in nanoseconds
// TODO use a better timer
extern control def currentTimeNanos(): Int =
"$effekt.delayed(() => new Date().getTime() * 1000)"
"$effekt.delayed(() => new Date().getTime() * 1000000)"

extern io def setTimeout(callback: () => Unit at {}, timeout: Int): Unit =
"(function() { window.setTimeout(() => callback().run(), timeout); return $effekt.unit; })()"
Expand Down

0 comments on commit a609028

Please sign in to comment.