From d0ec9a362f9a6228b87ae36213837e1098ec0a0d Mon Sep 17 00:00:00 2001 From: dehnert Date: Mon, 7 Aug 2017 20:29:26 +0200 Subject: [PATCH] added time output to cli --- src/storm/cli/cli.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/storm/cli/cli.cpp b/src/storm/cli/cli.cpp index 33826447f..166ab07cf 100644 --- a/src/storm/cli/cli.cpp +++ b/src/storm/cli/cli.cpp @@ -1,5 +1,10 @@ #include "storm/cli/cli.h" +#include +#include +#include +#include + #include "storm/storage/SymbolicModelDescription.h" #include "storm/models/ModelBase.h" @@ -82,6 +87,14 @@ namespace storm { return 0; } + std::string currentTimeAndDate() { + auto now = std::chrono::system_clock::now(); + auto in_time_t = std::chrono::system_clock::to_time_t(now); + + std::stringstream ss; + ss << std::put_time(std::localtime(&in_time_t), "%d/%m/%Y %X"); + return ss.str(); + } void printHeader(std::string const& name, const int argc, const char* argv[]) { STORM_PRINT(name << " " << storm::utility::StormVersion::shortVersionString() << std::endl << std::endl); @@ -96,7 +109,8 @@ namespace storm { if (!command.empty()) { STORM_PRINT("Command line arguments: " << commandStream.str() << std::endl); - STORM_PRINT("Current working directory: " << storm::utility::cli::getCurrentWorkingDirectory() << std::endl << std::endl); + STORM_PRINT("Current working directory: " << storm::utility::cli::getCurrentWorkingDirectory() << std::endl); + STORM_PRINT("Current date/time: " << currentTimeAndDate() << std::endl << std::endl); } }