use nanoseconds lol

This commit is contained in:
Quaternions 2024-08-06 13:36:02 -07:00
parent 2366ca0f5f
commit 772c9eb0b7

View File

@ -17,13 +17,17 @@ pub struct Worker{
file:BotDebug, file:BotDebug,
} }
fn date()->String{
format!("{}",std::time::SystemTime::UNIX_EPOCH.elapsed().unwrap().as_nanos())
}
pub fn new<'a>(scope:&'a std::thread::Scope<'a,'_>)->crate::worker::QNWorker<'a,Instruction>{ pub fn new<'a>(scope:&'a std::thread::Scope<'a,'_>)->crate::worker::QNWorker<'a,Instruction>{
let mut worker=Worker{ let mut worker=Worker{
file:BotDebug::new().unwrap(), file:BotDebug::new(date()).unwrap(),
}; };
crate::worker::QNWorker::new(scope,move|instruction|{ crate::worker::QNWorker::new(scope,move|instruction|{
match instruction{ match instruction{
Instruction::Create=>worker.file=BotDebug::new().unwrap(), Instruction::Create=>worker.file=BotDebug::new(date()).unwrap(),
//Instruction::Delete=>worker.file.delete().unwrap(), //Instruction::Delete=>worker.file.delete().unwrap(),
Instruction::Push{ins}=>worker.file.push(ins).unwrap(), Instruction::Push{ins}=>worker.file.push(ins).unwrap(),
} }