summaryrefslogtreecommitdiff
path: root/examples/ClockerPlugIn/Timer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ClockerPlugIn/Timer.cpp')
-rw-r--r--examples/ClockerPlugIn/Timer.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/ClockerPlugIn/Timer.cpp b/examples/ClockerPlugIn/Timer.cpp
new file mode 100644
index 0000000..6719817
--- /dev/null
+++ b/examples/ClockerPlugIn/Timer.cpp
@@ -0,0 +1,28 @@
+// //////////////////////////////////////////////////////////////////////////
+// Implementation file Timer.cpp for class Timer
+// (c)Copyright 2000, Baptiste Lepilleur.
+// Created: 2002/04/19
+// //////////////////////////////////////////////////////////////////////////
+
+#include "Timer.h"
+
+
+void
+Timer::start()
+{
+ m_beginTime = clock();
+}
+
+
+void
+Timer::finish()
+{
+ m_elapsedTime = double(clock() - m_beginTime) / CLOCKS_PER_SEC;
+}
+
+
+double
+Timer::elapsedTime() const
+{
+ return m_elapsedTime;
+}