From f09be5c3b4909b774a1cd2a318a0e1a37ca83fc3 Mon Sep 17 00:00:00 2001 From: gereon Date: Tue, 30 Apr 2013 10:35:35 +0200 Subject: [PATCH] Made BaseGrammar constructor clang-compatible, fixed ms output of CPU usage --- src/parser/PrismParser/BaseGrammar.h | 2 +- src/storm.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/PrismParser/BaseGrammar.h b/src/parser/PrismParser/BaseGrammar.h index 0846eb12c..4bf4f3265 100644 --- a/src/parser/PrismParser/BaseGrammar.h +++ b/src/parser/PrismParser/BaseGrammar.h @@ -21,7 +21,7 @@ namespace prism { public: BaseGrammar(std::shared_ptr& state) : state(state) {} - static T& instance(std::shared_ptr& state = nullptr) { + static T& instance(std::shared_ptr state = nullptr) { if (BaseGrammar::instanceObject == nullptr) { BaseGrammar::instanceObject = std::shared_ptr(new T(state)); if (!state->firstRun) BaseGrammar::instanceObject->secondRun(); diff --git a/src/storm.cpp b/src/storm.cpp index bcdf399d7..b01d21951 100644 --- a/src/storm.cpp +++ b/src/storm.cpp @@ -44,12 +44,14 @@ #include #include #include +#include void printUsage() { struct rusage ru; getrusage(RUSAGE_SELF, &ru); std::cout << "Memory Usage: " << ru.ru_maxrss << "kB" << std::endl; + std::cout << "CPU time: " << ru.ru_utime.tv_sec << "." << std::setw(3) << std::setfill('0') << ru.ru_utime.tv_usec/1000 << " seconds" << std::endl; }