X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fstlplus%2Fsubsystems%2Ftimer.cpp;fp=src%2Fstlplus%2Fsubsystems%2Ftimer.cpp;h=0000000000000000000000000000000000000000;hb=5846afb00833cc72fe72422ca896d2387c712cb4;hp=9faac0fea6a86f5b8ba865402628267a9688b764;hpb=a97500609dc3c1b11f9786d32bc458eb00de4c36;p=chaz%2Fyoink diff --git a/src/stlplus/subsystems/timer.cpp b/src/stlplus/subsystems/timer.cpp deleted file mode 100644 index 9faac0f..0000000 --- a/src/stlplus/subsystems/timer.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// - -// Author: Andy Rushton -// Copyright: (c) Southampton University 1999-2004 -// (c) Andy Rushton 2004-2009 -// License: BSD License, see ../docs/license.html - -//////////////////////////////////////////////////////////////////////////////// -#include "timer.hpp" -#include "dprintf.hpp" -#include "time.hpp" - -//////////////////////////////////////////////////////////////////////////////// - -namespace stlplus -{ - -//////////////////////////////////////////////////////////////////////////////// - - timer::timer(void) - { - reset(); - } - - timer::~timer(void) - { - } - - void timer::reset(void) - { - m_clock = clock(); - m_time = time(0); - } - - float timer::cpu(void) const - { - return ((float)(clock() - m_clock)) / ((float)CLOCKS_PER_SEC); - } - - float timer::elapsed(void) const - { - return ((float)(time(0) - m_time)); - } - - std::string timer::text(void) const - { - return dformat("%4.2fs CPU, %s elapsed", cpu(), delaytime_string(time(0)-m_time).c_str()); - } - -//////////////////////////////////////////////////////////////////////////////// - - std::ostream& operator << (std::ostream& str, const timer& t) - { - return str << t.text(); - } - -//////////////////////////////////////////////////////////////////////////////// - -} // end namespace stlplus