Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
StopWatch.h
1 /*
2  * StopWatch class interface
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2005-12, IRIT UPS.
6  *
7  * OTAWA is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * OTAWA is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OTAWA; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 #ifndef ELM_SYS_STOP_WATCH_H
22 #define ELM_SYS_STOP_WATCH_H
23 
24 #include <elm/types.h>
25 #include <elm/util/Time.h>
26 
27 namespace elm { namespace sys {
28 
29 // Time type
30 typedef t::uint64 time_t;
31 
32 // StopWatch class
33 class StopWatch {
34 public:
35  void start(void);
36  void stop(void);
37  inline Time delay(void) const { return stop_time - start_time; }
38  inline Time startTime(void) const { return start_time; }
39  inline Time stopTime(void) const { return stop_time; }
40 private:
41  Time start_time, stop_time;
42 };
43 
44 } } // elm::sys
45 
46 #endif // ELM_SYS_STOP_WATCH_H
elm::sys::StopWatch
Definition: StopWatch.h:33
elm::sys::StopWatch::stopTime
Time stopTime(void) const
Definition: StopWatch.h:39
elm::sys::StopWatch::stop
void stop(void)
Definition: system_StopWatch.cpp:79
elm::Time
Definition: Time.h:29
elm
Definition: adapter.h:26
elm::t::uint64
unsigned long uint64
Definition: arch.h:33
elm::sys::StopWatch::start
void start(void)
Definition: system_StopWatch.cpp:56
elm::sys::StopWatch::delay
Time delay(void) const
Definition: StopWatch.h:37
elm::sys::StopWatch::startTime
Time startTime(void) const
Definition: StopWatch.h:38
elm::sys::time_t
t::uint64 time_t
Definition: StopWatch.h:30