From a7186a63ca17bfece10de983c16029bcd63f08f2 Mon Sep 17 00:00:00 2001 From: Philip Nelson Date: Fri, 12 Oct 2018 22:25:13 -0600 Subject: [PATCH] fix includes --- .../5-TheConchShell/timer.hpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CS3100_OperatingSystems/5-TheConchShell/timer.hpp b/CS3100_OperatingSystems/5-TheConchShell/timer.hpp index 7fafe64..0d2e91d 100644 --- a/CS3100_OperatingSystems/5-TheConchShell/timer.hpp +++ b/CS3100_OperatingSystems/5-TheConchShell/timer.hpp @@ -5,7 +5,9 @@ #include #include #include +#include #include +#include class Timer { @@ -25,7 +27,8 @@ class Timer f(); auto end = std::chrono::high_resolution_clock::now(); - auto result = std::chrono::duration(end - start).count(); + auto result = + std::chrono::duration(end - start).count(); times.push_back(result); // save() @@ -57,7 +60,8 @@ class Timer //return time segment double calcTime() { - return std::chrono::duration (_end - _start).count(); + return std::chrono::duration (_end - + _start).count(); } */ @@ -65,7 +69,7 @@ class Timer std::string ptime() { double total = 0.0; - for (auto &&t : times) + for (auto&& t : times) total += t; int s = total / 1000000; @@ -76,8 +80,8 @@ class Timer std::ostringstream oss; - oss << "Time spent executing child processes: " << s << " seconds " << millis - << " milliseconds and " << micros << " microseconds"; + oss << "Time spent executing child processes: " << s << " seconds " + << millis << " milliseconds and " << micros << " microseconds"; return oss.str(); } @@ -97,7 +101,7 @@ class Timer { double avg = getAverage(); double dev = 0; - for (auto &&e : times) + for (auto&& e : times) dev += pow((e - avg), 2); return sqrt(dev / times.size()); }