summaryrefslogtreecommitdiffstats
path: root/src/test/test_global.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:47:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:47:37 +0000
commit00e2eb4fd0266c5be01e3a527a66aaad5ab4b634 (patch)
treea6a58bd544eb0b76b9d3acc678ea88791acca045 /src/test/test_global.cpp
parentInitial commit. (diff)
downloadlibixion-00e2eb4fd0266c5be01e3a527a66aaad5ab4b634.tar.xz
libixion-00e2eb4fd0266c5be01e3a527a66aaad5ab4b634.zip
Adding upstream version 0.19.0.upstream/0.19.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test_global.cpp')
-rw-r--r--src/test/test_global.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/test_global.cpp b/src/test/test_global.cpp
new file mode 100644
index 0000000..0325b9c
--- /dev/null
+++ b/src/test/test_global.cpp
@@ -0,0 +1,24 @@
+#include "test_global.hpp"
+
+namespace ixion { namespace test {
+
+stack_printer::stack_printer(std::string msg) :
+ m_msg(std::move(msg))
+{
+ std::cerr << m_msg << ": --begin" << std::endl;
+ m_start_time = get_time();
+}
+
+stack_printer::~stack_printer()
+{
+ double end_time = get_time();
+ std::cerr << m_msg << ": --end (duration: " << (end_time-m_start_time) << " sec)" << std::endl;
+}
+
+double stack_printer::get_time() const
+{
+ double v = std::chrono::system_clock::now().time_since_epoch() / std::chrono::milliseconds(1);
+ return v / 1000.0;
+}
+
+}}