diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-29 13:17:30 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-29 13:17:30 +0000 |
| commit | fc6ff10acb9d00ea1c8c5924869e0efbd38093c5 (patch) | |
| tree | a4cb5d9d9d0ea2702de42df1e3c2fbe40185e293 /docs/std/time.md | |
| parent | da9e8758e9d89dc7362be67f8e7573309efe170c (diff) | |
Objective-C interop + a few improvements
Diffstat (limited to 'docs/std/time.md')
| -rw-r--r-- | docs/std/time.md | 38 |
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. |
