From ba48c564cefa857c15f4ba7fe142800b4a40b5a3 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 12 Dec 2023 19:20:54 +0100 Subject: [PATCH] Print time in miliseconds --- aes-32bit/aes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aes-32bit/aes.cpp b/aes-32bit/aes.cpp index acd513a..7f00c1f 100644 --- a/aes-32bit/aes.cpp +++ b/aes-32bit/aes.cpp @@ -206,7 +206,8 @@ int main(int argc, char* argv[]) } const auto end{std::chrono::steady_clock::now()}; const std::chrono::duration elapsed_seconds{end - start}; + auto milliseconds = std::chrono::duration_cast(elapsed_seconds).count(); std::cout << "AES (" << cycles << " runs)\nElapsed time: "; - std::cout << elapsed_seconds.count() << "s\n"; // Before C++20 + std::cout << milliseconds << "ms\n"; // Before C++20 }