Browse Source

Made BaseGrammar constructor clang-compatible, fixed ms output of CPU usage

tempestpy_adaptions
gereon 12 years ago
parent
commit
f09be5c3b4
  1. 2
      src/parser/PrismParser/BaseGrammar.h
  2. 2
      src/storm.cpp

2
src/parser/PrismParser/BaseGrammar.h

@ -21,7 +21,7 @@ namespace prism {
public: public:
BaseGrammar(std::shared_ptr<VariableState>& state) : state(state) {} BaseGrammar(std::shared_ptr<VariableState>& state) : state(state) {}
static T& instance(std::shared_ptr<VariableState>& state = nullptr) {
static T& instance(std::shared_ptr<VariableState> state = nullptr) {
if (BaseGrammar::instanceObject == nullptr) { if (BaseGrammar::instanceObject == nullptr) {
BaseGrammar::instanceObject = std::shared_ptr<T>(new T(state)); BaseGrammar::instanceObject = std::shared_ptr<T>(new T(state));
if (!state->firstRun) BaseGrammar::instanceObject->secondRun(); if (!state->firstRun) BaseGrammar::instanceObject->secondRun();

2
src/storm.cpp

@ -44,12 +44,14 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <iostream> #include <iostream>
#include <iomanip>
void printUsage() { void printUsage() {
struct rusage ru; struct rusage ru;
getrusage(RUSAGE_SELF, &ru); getrusage(RUSAGE_SELF, &ru);
std::cout << "Memory Usage: " << ru.ru_maxrss << "kB" << std::endl; 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;
} }

Loading…
Cancel
Save