From 2e6c297a06bfa4667249579f2b82c0a4a55a874d Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 30 Dec 2019 18:59:00 -0500 Subject: [PATCH] added sleep functionality --- src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 883d1a6..6bd67bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,16 +1,16 @@ // external crates getting imported -extern crate chrono; extern crate reqwest; extern crate select; extern crate serde; extern crate serde_derive; extern crate serde_json; -extern crate time; + +// std lib imports +use std::{thread, time}; // actual third party library being imported use serde::{Deserialize, Serialize}; use serde_json::Result; -use time::Duration; // local files that need to be imported mod app; @@ -35,7 +35,8 @@ fn main() { _ => println!("Oops!"), } - time::Duration::seconds(1); + let sec = time::Duration::from_secs(1); + thread::sleep(sec); //println!("{:?}", text as str); } }