summaryrefslogtreecommitdiff
path: root/docs/std/time.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/std/time.md')
-rw-r--r--docs/std/time.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/std/time.md b/docs/std/time.md
new file mode 100644
index 0000000..97dd208
--- /dev/null
+++ b/docs/std/time.md
@@ -0,0 +1,38 @@
+# Time (`std/time.zc`)
+
+The `std/time` module provides functionality for measuring time and sleeping.
+
+## Usage
+
+```zc
+import "std/time.zc"
+```
+
+## Structs
+
+### Struct `Duration`
+
+Represents a span of time in milliseconds.
+
+#### Methods
+
+- **`fn from_ms(ms: U64) -> Duration`**
+ Creates a duration from milliseconds.
+
+- **`fn from_secs(s: U64) -> Duration`**
+ Creates a duration from seconds.
+
+### Struct `Time`
+
+Utilities for time manipulation.
+
+#### Methods
+
+- **`fn now() -> U64`**
+ Returns the current system time in milliseconds since the epoch.
+
+- **`fn sleep(d: Duration)`**
+ Sleeps for the specified duration.
+
+- **`fn sleep_ms(ms: U64)`**
+ Sleeps for the specified number of milliseconds.