Logo

Programming-Idioms

  • Dart
  • Rust

Idiom #185 Execute function in 30 seconds

Schedule the execution of f(42) in 30 seconds.

use std::time::Duration;
use std::thread::sleep;
sleep(Duration::new(30, 0));
f(42);
Future.delayed(const Duration(seconds: 30), () => f(42));
(do (Thread/sleep 30000)
    (f 42))

Clojure is a hosted language, and relies on host interop for things like this

New implementation...
< >
programming-idioms.org