diff --git a/src/storm/cli/cli.cpp b/src/storm/cli/cli.cpp index c1f2cf960..0f53aa2d3 100644 --- a/src/storm/cli/cli.cpp +++ b/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); } } diff --git a/src/storm/utility/Stopwatch.cpp b/src/storm/utility/Stopwatch.cpp index faefdb472..0a08a4e19 100644 --- a/src/storm/utility/Stopwatch.cpp +++ b/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; }