Octane v1.01.20 - The Open Compression Toolkit for C++ http://octane.sourceforge.net/
Homepage | Main | Modules | Class Hierarchy | Compound List | File List | Compound Members | Related Pages

OctaneTimer Class Reference
[Utility]

#include <timer.hpp>

List of all members.


Detailed Description

Simple class for timing code (low resolution).

The timer class uses the clock() function from the C standard library.

Definition at line 32 of file timer.hpp.

Public Member Functions

 OctaneTimer ()
 Constructor. Sets the begin time to the current time.

void start ()
 Reset the begin time to the current time.

float stop ()
 Compute the elapsed time between the begin time and the current time.

float get_elapsed () const
 Get the elapsed time between the last start() and the latest stop().


Member Function Documentation

float OctaneTimer::stop  )  [inline]
 

Compute the elapsed time between the begin time and the current time.

Returns:
elapsed time.

Definition at line 44 of file timer.hpp.

Referenced by OctaneCompressor::Compress(), OctaneCompressor::CreateSymbolsAndModelsUsingStream(), OctaneCompressor::Decompress(), OctaneTester::ExecuteCommandsFromStream(), OctaneScopeTimer::get_elapsed(), OctaneCompressor::LoadState(), OctaneCompressor::Save(), and OctaneScopeTimer::~OctaneScopeTimer().

00045     {
00046         clock_t end = clock();
00047         elapsed = (float)(end - begin)/(float)CLOCKS_PER_SEC;
00048         return elapsed;
00049     }

float OctaneTimer::get_elapsed  )  const [inline]
 

Get the elapsed time between the last start() and the latest stop().

Returns:
elapsed time.

Definition at line 54 of file timer.hpp.

00054 { return elapsed; }


The documentation for this class was generated from the following file:  
Generated on 20 May 2004 by doxygen 1.3.3