// rhythm-cycle-30hr.el — rhythm_cycle_phase(0.5) under CycleCalendar(30.hours) // returns the next instant at the 15-hour mark of the cycle. fn run_test() -> Int { let period: Duration = 30.hours let cal: Calendar = cycle_calendar(period) let r: Rhythm = rhythm_cycle_phase(0.5) let base: Instant = unix_seconds(0) let next: Instant = rhythm_next_after(r, base, cal) let elapsed_ns: Duration = next - base let elapsed_secs: Int = duration_to_seconds(elapsed_ns) // 15 hours = 54000 seconds. return elapsed_secs } fn main() -> Void { println(int_to_str(run_test())) }