From 47dc69b7bb138d2a0482c94c86e307b2983f7473 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 12 Jan 2017 18:32:27 +0100 Subject: [PATCH] [Auth] Slight optimization --- src/Components/Modules/Auth.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Components/Modules/Auth.cpp b/src/Components/Modules/Auth.cpp index 32866446..e1aac55d 100644 --- a/src/Components/Modules/Auth.cpp +++ b/src/Components/Modules/Auth.cpp @@ -12,12 +12,12 @@ namespace Components { if (Auth::TokenContainer.generating) { - static int lastCalc = 0; static double mseconds = 0; + static Utils::Time::Interval interval; - if (!lastCalc || (Game::Sys_Milliseconds() - lastCalc) > 500) + if (interval.elapsed(500ms)) { - lastCalc = Game::Sys_Milliseconds(); + interval.update(); int diff = Game::Sys_Milliseconds() - Auth::TokenContainer.startTime; double hashPMS = (Auth::TokenContainer.hashes * 1.0) / diff;