Skip to content

Commit

Permalink
feat(client): server time getter
Browse files Browse the repository at this point in the history
  • Loading branch information
vadzz-dev committed Feb 14, 2024
1 parent afb16ad commit 5f49d65
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions types/Metric.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,36 @@ namespace alt
value = _value;
}

void Add(uint64_t _value)
{
value += _value;
}

void Inc()
{
++value;
}

void Begin()
{
lastBegin = Time();
}

// Deprecated old behavior, remove in future
void End()
{
value = Time() - lastBegin;
}

void End2()
{
if (lastBegin == 0)
return; // Warn?

Add(Time() - lastBegin);
lastBegin = 0;
}

void Destroy()
{
exists = false;
Expand Down

0 comments on commit 5f49d65

Please sign in to comment.