Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/CBenchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CBenchmark.cpp')
-rwxr-xr-xsrc/CBenchmark.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/CBenchmark.cpp b/src/CBenchmark.cpp
new file mode 100755
index 0000000..0fe0dfd
--- /dev/null
+++ b/src/CBenchmark.cpp
@@ -0,0 +1,42 @@
+#include "CBenchmark.h"
+
+CBenchmark::CBenchmark(bool aVisible)
+{
+ mTime = 1.f;
+ mCounter = mDisplayCounter = 0;
+ mVisible = aVisible;
+}
+
+CBenchmark::~CBenchmark(void)
+{
+}
+
+void CBenchmark::update(float aDt)
+{
+ mTime -= aDt;
+ if (mTime > 0.f)
+ {
+ mCounter++;
+ }
+ else
+ {
+ mDisplayCounter = mCounter;
+ mTime = 1.f;
+ mCounter = 0;
+ }
+}
+
+void CBenchmark::setVisible(bool aVisible)
+{
+ mVisible = aVisible;
+}
+
+bool CBenchmark::getVisible(void) const
+{
+ return mVisible;
+}
+
+unsigned int CBenchmark::getDisplayCounter(void)
+{
+ return mDisplayCounter;
+}