From f05089dffe81419786776b60bc2dc13d2a421a5c Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Sat, 20 Apr 2002 20:54:36 +0000 Subject: THANKS: updated THANKS: updated * src/cppunit/DynamicLibraryManager.cpp: bugfix: did not pass library name to exception. * include/cppunit/TestPath.h: * src/cppunit/TestPath.cpp: changed into value object. * src/cppunit/BeosDynamicLibraryManager.cpp: integrated patch from Shibu Yoshiki for BeOS ('cuppa' project team). * src/DllPlugInTester/CommandLineParser.h: * src/DllPlugInTester/CommandLineParser.cpp: added. Command line parsing. * src/DllPlugInTester/DllPlugInTester.cpp: full command line support with parameters for plug-ins. * src/DllPlugInTester/makefile.am: * examples/simple/makefile.am: * examples/cppunittest/makefile.am: integrated Jeffrey Morgan patch, Unix side should be working again. * examples/ReadMe.txt: added. Brief description of each example. * examples/cppunittest/CppUnitTestPlugIn.cpp: * examples/cppunittest/CppUnitTestPlugIn.dsp: added. New project to build CppUnit's test suite as a test plug-in. * examples/cppunittest/CppUnitTestSuite.cpp: updated. Use new helper macros to create the test suite hierarchy. * examples/simple/simple_plugin.opt: added. Contains debug tab settings. * examples/ClockerPlugIn/ClockerListener.cpp: * examples/ClockerPlugIn/ClockerListener.h: * examples/ClockerPlugIn/Timer.cpp: * examples/ClockerPlugIn/Timer.h: * examples/ClockerPlugIn/WinNtTimer.cpp: * examples/ClockerPlugIn/WinNtTimer.h: * examples/ClockerPlugIn/ClockerPlugIn.cpp: * examples/ClockerPlugIn/ClockerPlugIn.dsp: added. test listener plug-in that times tests. * examples/DumperPlugIn/DumperListener.cpp: * examples/DumperPlugIn/DumperListener.h: * examples/DumperPlugIn/DumperPlugIn.cpp: * examples/DumperPlugIn/DumperPlugIn.dsp: added. test listener plug-in that dump the test tree. --- examples/ClockerPlugIn/Timer.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 examples/ClockerPlugIn/Timer.cpp (limited to 'examples/ClockerPlugIn/Timer.cpp') 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; +} -- cgit v1.2.1