Skip to content

lib/time

import "github.com/eugenioenko/goalchemy/lib/time"

Package time provides Goalchemy’s virtual clock: Sleep advances it deterministically.

Function c csharp go java python rust swift typescript
Sleep yes yes yes yes yes yes yes yes
func Sleep(d Duration)

Suspend for a duration of scheduler time.

  • Gate: cooperative (may suspend the calling task)
  • Determinism: controlled
  • Contract: std.time.sleep 1.0.0