CEDRIC  Revision_backup-2009-02
StopWatch.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 2008 Boris Iven, Max Hermann
4  *
5  * This file is part of the "CEDRIC Event Display" application.
6  *
7  *****************************************************************************/
8 
9 #ifndef STOPWATCH_H
10 #define STOPWATCH_H
11 
12 #include <time.h>
13 
15 class StopWatch
16 {
17 public:
18  static void start() { startTime = clock(); }
20  static float stop() { stopTime = clock(); return (float)(stopTime-startTime)/CLOCKS_PER_SEC; }
21 
22  static clock_t startTime;
23  static clock_t stopTime;
24 
25 private:
27  StopWatch();
28 };
29 
30 #endif
Primitive timing functions. No nesting supported!
Definition: StopWatch.h:15
static float stop()
Returns seconds passed since start() was called.
Definition: StopWatch.h:20
static clock_t startTime
Definition: StopWatch.h:22
static void start()
Definition: StopWatch.h:18
static clock_t stopTime
Definition: StopWatch.h:23