task::spawn( async {
let mut interval = time::interval(Duration::from_millis(get_mining_info_interval));
while let it = interval.tick().await{
}
});
i want to use interval in a tokio. how can i execute some function in interval?
naim
#2
let mut i = tokio::time::interval(Duration::from_secs(1));
loop {
// wait a seconds
i.tick().await;
// do something
}
system
closed
#3
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.