From 772c9eb0b75f2305d4f7218493362124f21c0cd9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 6 Aug 2024 13:36:02 -0700 Subject: [PATCH] use nanoseconds lol --- src/bot_worker.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bot_worker.rs b/src/bot_worker.rs index 29c78ad..3e2d12d 100644 --- a/src/bot_worker.rs +++ b/src/bot_worker.rs @@ -17,13 +17,17 @@ pub struct Worker{ 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>{ let mut worker=Worker{ - file:BotDebug::new().unwrap(), + file:BotDebug::new(date()).unwrap(), }; crate::worker::QNWorker::new(scope,move|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::Push{ins}=>worker.file.push(ins).unwrap(), }