Browse Source

Fixed restoring the value of std::cout.fill() after setting it to '0'

tempestpy_adaptions
TimQu 8 years ago
parent
commit
b1f4dfd9d1
  1. 6
      src/storm/cli/cli.cpp
  2. 4
      src/storm/utility/Stopwatch.cpp

6
src/storm/cli/cli.cpp

@ -808,10 +808,12 @@ namespace storm {
uint64_t maximumResidentSizeInMegabytes = ru.ru_maxrss / 1024;
#endif
std::cout << " * peak memory usage: " << maximumResidentSizeInMegabytes << "MB" << std::endl;
std::cout << " * CPU time: " << ru.ru_utime.tv_sec << "." << std::setw(3) << std::setfill('0') << ru.ru_utime.tv_usec/1000 << "s" << std::endl;
char oldFillChar = std::cout.fill('0');
std::cout << " * CPU time: " << ru.ru_utime.tv_sec << "." << std::setw(3) << ru.ru_utime.tv_usec/1000 << "s" << std::endl;
if (wallclockMilliseconds != 0) {
std::cout << " * wallclock time: " << (wallclockMilliseconds/1000) << "." << std::setw(3) << std::setfill('0') << (wallclockMilliseconds % 1000) << "s" << std::endl;
std::cout << " * wallclock time: " << (wallclockMilliseconds/1000) << "." << std::setw(3) << (wallclockMilliseconds % 1000) << "s" << std::endl;
}
std::cout.fill(oldFillChar);
}
}

4
src/storm/utility/Stopwatch.cpp

@ -43,7 +43,9 @@ namespace storm {
}
std::ostream& operator<<(std::ostream& out, Stopwatch const& stopwatch) {
out << stopwatch.getTimeInSeconds() << "." << std::setw(3) << std::setfill('0') << (stopwatch.getTimeInMilliseconds() % 1000) << "s";
char oldFillChar = out.fill('0');
out << stopwatch.getTimeInSeconds() << "." << std::setw(3) << (stopwatch.getTimeInMilliseconds() % 1000) << "s";
out.fill(oldFillChar);
return out;
}

Loading…
Cancel
Save