mumble/src/Timer.h
Robert 56db3410c5 MAINT: Update copyright notice to 2021 (Part II)
Apparently the first commit (59ae429972)
did not include all files.

Furthermore the used script tended to produce funny results in certain
cases. This has been fixed and as a result thereof a few more changes
were made in this second run.
2021-04-09 15:41:49 +02:00

37 lines
798 B
C++

// Copyright 2007-2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#ifndef MUMBLE_TIMER_H_
#define MUMBLE_TIMER_H_
#include <QtCore/QtGlobal>
// All timer resolutions are in microseconds.
class Timer {
protected:
quint64 uiStart;
static quint64 now();
public:
Timer(bool start = true);
bool isElapsed(quint64 us);
quint64 elapsed() const;
quint64 restart();
bool isStarted() const;
/**
* Compares the elapsed time, not the start time
*/
bool operator<(const Timer &other) const;
/**
* Compares the elapsed time, not the start time
*/
bool operator>(const Timer &other) const;
};
#endif