[Auth] Slight optimization
This commit is contained in:
parent
428c1f24c3
commit
47dc69b7bb
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user