PTimer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PObject.h>
17 
18 PAPILLON_BEGIN_NAMESPACE
19 
28 class PAPILLON_API_CORE PTimer : public PObject
29 {
30 public:
37  PTimer(papillon::int32 keepNMostRecentMeasures = 100);
38 
42  virtual ~PTimer();
43 
47  PTimer(const PTimer& other);
48 
52  PTimer& operator=(const PTimer& other);
53 
57  void Reset();
58 
65  void Start();
66 
77  double Stop();
78 
87  double ElapsedSec() const;
88 
97  double ElapsedMs() const;
98 
103  double Min() const;
104 
109  double Max() const;
110 
115  double Average() const;
116 
120  papillon::int32 Size() const;
121 
126  double Get(papillon::int32 n) const;
127 
131  PString ElapsedToString() const;
132 };
133 
134 PAPILLON_END_NAMESPACE
The PString class provides an Unicode character strings.
Definition: PString.h:37
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PTimer class provides a high precision chronometer (highest precision available on the host)...
Definition: PTimer.h:28
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45