aboutsummaryrefslogtreecommitdiff
path: root/src/system-stats/system-stats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/system-stats/system-stats.cpp')
-rw-r--r--src/system-stats/system-stats.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/system-stats/system-stats.cpp b/src/system-stats/system-stats.cpp
new file mode 100644
index 0000000..4d2f43e
--- /dev/null
+++ b/src/system-stats/system-stats.cpp
@@ -0,0 +1,28 @@
+#include <thread>
+#include <iostream>
+
+#include "common.h"
+
+using namespace std::literals;
+
+int main()
+{
+ namespace CH = std::chrono;
+
+ auto logf = LogFile();
+ refstream stream = std::ref(std::cout);
+
+ while(1) {
+ logf.change(stream);
+ auto epoch = CH::duration_cast<CH::seconds>(
+ CH::system_clock::now().time_since_epoch()
+ ).count();
+
+ stream.get() << "begin\t" << epoch << std::endl;
+ stream.get() << dumpReport();
+ stream.get() << "end\t" << epoch << std::endl;
+
+ std::this_thread::sleep_for(1s);
+ }
+ return 0;
+}