Skip to content

Commit 19c2855

Browse files
committed
feat(examples): use sleep in the app basic
1 parent fd6ad85 commit 19c2855

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/basic/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![feature(const_mut_refs)]
55
#![feature(unsafe_block_in_unsafe_fn)] // `unsafe fn` doesn't imply `unsafe {}`
66
#![deny(unsafe_op_in_unsafe_fn)]
7-
use constance::{kernel::Task, sync::Mutex};
7+
use constance::{kernel::Task, prelude::*, sync::Mutex};
88

99
constance_port_std::use_port!(unsafe struct System);
1010

@@ -43,5 +43,8 @@ fn task1_body(_: usize) {
4343
}
4444

4545
fn task2_body(_: usize) {
46-
dbg!();
46+
loop {
47+
dbg!(System::time().unwrap());
48+
System::sleep(constance::time::Duration::from_secs(1)).unwrap();
49+
}
4750
}

0 commit comments

Comments
 (0)