Vaqt: High-precision date/time in C
a day ago
- #time handling
- #C programming
- #nanosecond precision
- The vaqt package provides time and duration handling in C with nanosecond precision.
- Supports C99 (recommends C11 on Windows for higher precision).
- Defines two main types: Time (seconds and nanoseconds since 0001-01-01) and Duration (nanoseconds).
- Time operations include creation, extraction, Unix time conversion, calendar time, comparison, arithmetic, rounding, and formatting.
- Duration can represent up to ~290 years in nanoseconds.
- Includes functions for marshaling and unmarshaling time values.
- Usage involves including the header and compiling with source files.
- Provides examples and tests; contributions are welcome under BSD 3-Clause License.
- Inspired by Go's stdlib time package.