Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SbElapsedTime.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23// SbElapsedTime.h
24
25#ifndef _SB_ELAPSED_TIME_H_
26#define _SB_ELAPSED_TIME_H_
27
28#include <Inventor/SbBase.h>
29#include <Inventor/SbTime.h>
30#include <Inventor/STL/iostream>
31
46
47 public:
52
56 void reset();
57
61 double getElapsed() const;
62
67
68 private:
69
76 static uint64_t getTimeStamp();
77
81 friend std::ostream& operator << (std::ostream& os, const SbElapsedTime& t);
82
83 private:
87 static SbBool hasHiResTimer();
88
89 // Does this system have a hi-res timer?
90 static SbBool haveHiRes;
91
92 // Set by constructor and reset method
93 SbTime m_startTime;
94
95#ifdef _WIN32
96 // Frequency of high performance counter
97 static double m_frequency;
98
99 // Set by constructor and reset method
100 LARGE_INTEGER m_startCount;
101#endif
102};
103
104#endif //_SB_ELAPSED_TIME_H_
105
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class for measur...
SbTime getElapsedTime() const
Gets elapsed time.
friend std::ostream & operator<<(std::ostream &os, const SbElapsedTime &t)
Writes the time to the specified output stream.
SbElapsedTime()
Constructor (initializes timer)
double getElapsed() const
Gets elapsed time in seconds.
void reset()
Resets timer.
Class for representation of a time.
Definition SbTime.h:91
int SbBool
Boolean type.
Definition SbBase.h:87