Crate simple_time

Source
Expand description

A very simple, no_std friendly time library for Rust that provides:

  • a Time type that wraps an i128 representing nanoseconds since the Unix epoch
  • a Duration type that wraps an i128 representing a number of nanoseconds
  • const fn math operations for Time and Duration, plus basic core::ops trait implementations

Any conversion to calendar time and parsing and formatting of date/time strings should be accomplished with other libraries. This library just supports very simple high precision time calculations and nothing more.

Structsยง

Duration
Duration is a number of nanoseconds. The default value of Duration is 0 nanoseconds.
Time
Time is as the number of nanoseconds since the Unix epoch. The default value of Time is the Unix epoch 1970-01-01 00:00:00 UTC. This default may not be suitable for all applications, so wrap time in an Option.