Skip to main content

Module time

Module time 

Source
Expand description

Time Utilities

Provides time-related functions for timestamps and delays.

§Platform Support

  • Native: Uses std::time::SystemTime and std::thread::sleep
  • WASM: Not available (use browser APIs via JavaScript interop)

§Example

use logicaffeine_system::time;

let start = time::now();
time::sleep(1000); // Sleep for 1 second
let elapsed = time::now() - start;
println!("Elapsed: {}ms", elapsed);

Functions§

now
Returns the current time as milliseconds since Unix epoch.
sleep
Blocks the current thread for the specified duration.