Implement wall clock time meas.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#define CXXOPTS_VECTOR_DELIMITER '\0'
|
||||
#include "libs/cxxopts/include/cxxopts.hpp"
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
|
||||
#ifdef YOSYS_ENABLE_READLINE
|
||||
# include <readline/readline.h>
|
||||
@@ -195,6 +196,7 @@ namespace Yosys {
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
auto wall_clock_start = std::chrono::steady_clock::now();
|
||||
std::string frontend_command = "auto";
|
||||
std::string backend_command = "auto";
|
||||
std::vector<std::string> vlog_defines;
|
||||
@@ -700,9 +702,12 @@ int main(int argc, char **argv)
|
||||
meminfo = stringf(", MEM: %.2f MB peak",
|
||||
ru_buffer.ru_maxrss / (1024.0 * 1024.0));
|
||||
#endif
|
||||
log("End of script. Logfile hash: %s%sCPU: user %.2fs system %.2fs%s\n", hash,
|
||||
double wall_seconds = std::chrono::duration<double>(
|
||||
std::chrono::steady_clock::now() - wall_clock_start).count();
|
||||
|
||||
log("End of script. Logfile hash: %s%sCPU: user %.2fs system %.2fs, wall: %.2fs%s\n", hash,
|
||||
stats_divider.c_str(), ru_buffer.ru_utime.tv_sec + 1e-6 * ru_buffer.ru_utime.tv_usec,
|
||||
ru_buffer.ru_stime.tv_sec + 1e-6 * ru_buffer.ru_stime.tv_usec, meminfo.c_str());
|
||||
ru_buffer.ru_stime.tv_sec + 1e-6 * ru_buffer.ru_stime.tv_usec, wall_seconds, meminfo.c_str());
|
||||
#endif
|
||||
log("%s\n", yosys_maybe_version());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user