blob: 35b3bd976f9c299a6b3e4cb04651732cb30b18bc [file] [log] [blame]
#![no_std]
use core::fmt::Write;
use futures::future;
use libtock::console::Console;
use libtock::timer;
use libtock::timer::Duration;
#[libtock::main]
async fn main() -> libtock::result::TockResult<()> {
let mut console = Console::new();
let mut with_callback = timer::with_callback(|_, _| {
writeln!(
console,
"This line is printed 2 seconds after the start of the program.",
)
.unwrap();
});
let mut timer = with_callback.init()?;
timer.set_alarm(Duration::from_ms(2000))?;
future::pending().await
}