aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/tests.cpp')
-rw-r--r--src/tests/tests.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp
index 704ff36a8..3137c5ba7 100644
--- a/src/tests/tests.cpp
+++ b/src/tests/tests.cpp
@@ -37,6 +37,23 @@ void Test::Result::merge(const Result& other)
m_log.insert(m_log.end(), other.m_log.begin(), other.m_log.end());
}
+void Test::Result::start_timer()
+ {
+ if(m_started == 0)
+ {
+ m_started = Test::timestamp();
+ }
+ }
+
+void Test::Result::end_timer()
+ {
+ if(m_started > 0)
+ {
+ m_ns_taken += Test::timestamp() - m_started;
+ m_started = 0;
+ }
+ }
+
void Test::Result::test_note(const std::string& note)
{
if(note != "")