Skip to main content

Module time

Module time 

Source
Expand description

Time and clock abstractions for synchronization

§Time and clock abstractions for Rill

This module provides timing and synchronization primitives for real-time signal processing. It includes clock sources, tick information, and utilities for sample-accurate timing.

§Key Components

  • ClockTick: A single tick of the audio clock with timing information
  • ClockSource: Trait for objects that can provide clock ticks
  • SystemClock: Software-based clock using system time
  • [Clock]: Legacy clock trait (deprecated, use ClockSource)

§Example

use rill_core::time::{SystemClock, ClockSource};

let mut clock = SystemClock::with_sample_rate(44100.0);
let tick = clock.next_tick(64);

println!("Sample position: {}", tick.sample_pos);
println!("Time since last tick: {} seconds", tick.delta_seconds());

Modules§

prelude
Prelude for convenient imports

Structs§

ClockTick
A tick of the audio clock
SystemClock
High-precision system clock

Enums§

TimeError
Errors that can occur during time and clock operations

Traits§

ClockSource
A source of clock ticks for signal processing

Type Aliases§

TimeResult
Result type for time operations