mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Timer: Dead code removal
This commit is contained in:
parent
87b1809ef4
commit
59b98cf302
2 changed files with 0 additions and 56 deletions
|
@ -112,40 +112,3 @@ void Timer::subtract (unsigned long value)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
HighResTimer::HighResTimer ()
|
||||
{
|
||||
_start.tv_sec = 0;
|
||||
_start.tv_usec = 0;
|
||||
|
||||
_stop.tv_sec = 0;
|
||||
_stop.tv_usec = 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
HighResTimer::~HighResTimer ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void HighResTimer::start ()
|
||||
{
|
||||
gettimeofday (&_start, NULL);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void HighResTimer::stop ()
|
||||
{
|
||||
gettimeofday (&_stop, NULL);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
double HighResTimer::total () const
|
||||
{
|
||||
if (_stop.tv_sec > 0 || _stop.tv_usec > 0)
|
||||
return (_stop.tv_sec - _start.tv_sec) +
|
||||
(_stop.tv_usec - _start.tv_usec) / 1000000.0;
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
19
src/Timer.h
19
src/Timer.h
|
@ -52,25 +52,6 @@ private:
|
|||
unsigned long _total;
|
||||
};
|
||||
|
||||
// HighResTimer is a stop watch with microsecond resolution.
|
||||
class HighResTimer
|
||||
{
|
||||
public:
|
||||
HighResTimer ();
|
||||
~HighResTimer ();
|
||||
HighResTimer (const HighResTimer&);
|
||||
HighResTimer& operator= (const HighResTimer&);
|
||||
|
||||
void start ();
|
||||
void stop ();
|
||||
double total () const;
|
||||
|
||||
private:
|
||||
struct timeval _start;
|
||||
struct timeval _stop;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue