[−][src]Module cala::clock
API for getting the date and time of day. Enable with the clock feature.
Getting Started
// Print current Local time and UTC time. let clock = cala::Clock::new(); println!("Local: {}", clock); println!("UTC: {:?}", clock); // Print 'Hello, world #!' every 1/3 seconds let mut a = 0; loop { let now = cala::Clock::new(); let b = now.since(&clock, cala::SECOND / 3); if a != b { a = b; println!("Hello, world {}!", a); } }
Structs
| Clock | A calendar date and time. Stored as UTC. |
| Duration | An amount of time. |
Enums
| DayOfWeek | Which day of the week. |
| Month | Month of the year. |
Constants
| DAY | 1 day. |
| HOUR | 1 hour. |
| MICROSECOND | 1 microsecond. |
| MILLISECOND | 1 millisecond. |
| MINUTE | 1 minute. |
| NANOSECOND | 1 nanosecond. |
| SECOND | 1 second. |