From 1609c23fea5d27a6426fb1769fcd128a06d1683c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 28 Jul 2024 13:14:10 -0400 Subject: [PATCH] Fix cputime being zero --- include/verilatedos_c.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/verilatedos_c.h b/include/verilatedos_c.h index a568e53fa..71f979529 100644 --- a/include/verilatedos_c.h +++ b/include/verilatedos_c.h @@ -51,10 +51,10 @@ double DeltaCpuTime::gettime() VL_MT_SAFE { #else // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) timespec ts; - if (0 != clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts)) // MT-Safe + if (0 == clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts)) // MT-Safe // LCOV_EXCL_BR_LINE return ts.tv_sec + ts.tv_nsec * 1e-9; #endif - return 0.0; + return 0.0; // LCOV_EXCL_LINE } double DeltaWallTime::gettime() VL_MT_SAFE { #if defined(_WIN32) || defined(__MINGW32__) @@ -66,9 +66,9 @@ double DeltaWallTime::gettime() VL_MT_SAFE { #else // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) timespec ts; - if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) // MT-Safe + if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) // MT-Safe // LCOV_EXCL_BR_LINE return ts.tv_sec + ts.tv_nsec * 1e-9; - return 0.0; + return 0.0; // LCOV_EXCL_LINE #endif }