From 204b3ec31b36d965b32cd6fdbaefd08fd5e7a949 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Thu, 11 Jan 2024 00:22:00 +0100 Subject: [PATCH] iox-#2150 Add 'iox' prefix to POSIX time functions --- .../posix/time/source/deadline_timer.cpp | 4 +- .../reporting/source/console_logger.cpp | 2 +- .../moduletests/test_time_unit_duration.cpp | 4 +- iceoryx_hoofs/time/source/duration.cpp | 4 +- .../include/iceoryx_platform/time.hpp | 12 ++++++ .../linux/include/iceoryx_platform/time.hpp | 12 ++++++ .../mac/include/iceoryx_platform/time.hpp | 27 +++++++++---- iceoryx_platform/mac/source/time.cpp | 24 ++++++------ .../qnx/include/iceoryx_platform/time.hpp | 12 ++++++ .../unix/include/iceoryx_platform/time.hpp | 12 ++++++ .../win/include/iceoryx_platform/time.hpp | 33 +++++++++------- iceoryx_platform/win/source/time.cpp | 39 ++++++++++--------- iceoryx_posh/source/runtime/heartbeat.cpp | 4 +- 13 files changed, 128 insertions(+), 61 deletions(-) diff --git a/iceoryx_hoofs/posix/time/source/deadline_timer.cpp b/iceoryx_hoofs/posix/time/source/deadline_timer.cpp index b14a08e0b89..5c9933e51b2 100644 --- a/iceoryx_hoofs/posix/time/source/deadline_timer.cpp +++ b/iceoryx_hoofs/posix/time/source/deadline_timer.cpp @@ -58,11 +58,11 @@ iox::units::Duration deadline_timer::remainingTime() const noexcept iox::units::Duration deadline_timer::getCurrentMonotonicTime() noexcept { timespec time_since_epoch{0, 0}; - IOX_ENSURES_WITH_MSG(!IOX_POSIX_CALL(clock_gettime)(CLOCK_MONOTONIC, &time_since_epoch) + IOX_ENSURES_WITH_MSG(!IOX_POSIX_CALL(iox_clock_gettime)(CLOCK_MONOTONIC, &time_since_epoch) .failureReturnValue(-1) .evaluate() .has_error(), - "An error which should never happen occured during 'clock_gettime'!"); + "An error which should never happen occured during 'iox_clock_gettime'!"); return iox::units::Duration{time_since_epoch}; } } // namespace iox diff --git a/iceoryx_hoofs/reporting/source/console_logger.cpp b/iceoryx_hoofs/reporting/source/console_logger.cpp index 3110560e7be..0e8cd3d8b68 100644 --- a/iceoryx_hoofs/reporting/source/console_logger.cpp +++ b/iceoryx_hoofs/reporting/source/console_logger.cpp @@ -59,7 +59,7 @@ void ConsoleLogger::createLogMessageHeader(const char* file, { timespec timestamp{0, 0}; // intentionally avoid using 'IOX_POSIX_CALL' here to keep the logger dependency free - if (clock_gettime(CLOCK_REALTIME, ×tamp) != 0) + if (iox_clock_gettime(CLOCK_REALTIME, ×tamp) != 0) { timestamp = {0, 0}; // intentionally do nothing since a timestamp from 01.01.1970 already indicates an issue with the clock diff --git a/iceoryx_hoofs/test/moduletests/test_time_unit_duration.cpp b/iceoryx_hoofs/test/moduletests/test_time_unit_duration.cpp index 92b1264cdfa..5cf61a50261 100644 --- a/iceoryx_hoofs/test/moduletests/test_time_unit_duration.cpp +++ b/iceoryx_hoofs/test/moduletests/test_time_unit_duration.cpp @@ -1080,13 +1080,13 @@ TEST(Duration_test, ConvertTimespecWithMonotonicReference) constexpr int64_t NANOSECONDS{66}; struct timespec referenceTimeForMonotonicEpoch = {}; - ASSERT_FALSE((IOX_POSIX_CALL(clock_gettime)(CLOCK_MONOTONIC, &referenceTimeForMonotonicEpoch) + ASSERT_FALSE((IOX_POSIX_CALL(iox_clock_gettime)(CLOCK_MONOTONIC, &referenceTimeForMonotonicEpoch) .failureReturnValue(-1) .evaluate() .has_error())); struct timespec referenceTimeForUnixEpoch = {}; - ASSERT_FALSE((IOX_POSIX_CALL(clock_gettime)(CLOCK_REALTIME, &referenceTimeForUnixEpoch) + ASSERT_FALSE((IOX_POSIX_CALL(iox_clock_gettime)(CLOCK_REALTIME, &referenceTimeForUnixEpoch) .failureReturnValue(-1) .evaluate() .has_error())); diff --git a/iceoryx_hoofs/time/source/duration.cpp b/iceoryx_hoofs/time/source/duration.cpp index 046ed635cab..64d4564db35 100644 --- a/iceoryx_hoofs/time/source/duration.cpp +++ b/iceoryx_hoofs/time/source/duration.cpp @@ -53,8 +53,8 @@ struct timespec Duration::timespec(const TimeSpecReference reference) const noex // AXIVION Next Construct AutosarC++19_03-M5.0.3: False positive! CLOCK_REALTIME and CLOCK_MONOTONIC are of type clockid_t const clockid_t clockId{(reference == TimeSpecReference::Epoch) ? CLOCK_REALTIME : CLOCK_MONOTONIC}; IOX_ENSURES_WITH_MSG( - !IOX_POSIX_CALL(clock_gettime)(clockId, &referenceTime).failureReturnValue(-1).evaluate().has_error(), - "An error which should never happen occured during 'clock_gettime'!"); + !IOX_POSIX_CALL(iox_clock_gettime)(clockId, &referenceTime).failureReturnValue(-1).evaluate().has_error(), + "An error which should never happen occured during 'iox_clock_gettime'!"); const auto targetTime = Duration(referenceTime) + *this; diff --git a/iceoryx_platform/freertos/include/iceoryx_platform/time.hpp b/iceoryx_platform/freertos/include/iceoryx_platform/time.hpp index 400fe2d02ec..bfe1cb31e73 100644 --- a/iceoryx_platform/freertos/include/iceoryx_platform/time.hpp +++ b/iceoryx_platform/freertos/include/iceoryx_platform/time.hpp @@ -21,6 +21,18 @@ #include "FreeRTOS_POSIX.h" #include "FreeRTOS_POSIX/time.h" +#include #include +using iox_clockid_t = clockid_t; + +inline int iox_clock_gettime(iox_clockid_t clk_id, struct timespec* tp) +{ + return clock_gettime(clk_id, tp); +} +inline int iox_gettimeofday(struct timeval* tp, struct timezone* tzp) +{ + return gettimeofday(tp, tzp); +} + #endif // IOX_HOOFS_FREERTOS_PLATFORM_TIME_HPP diff --git a/iceoryx_platform/linux/include/iceoryx_platform/time.hpp b/iceoryx_platform/linux/include/iceoryx_platform/time.hpp index cd4f769b34b..53d35083fba 100644 --- a/iceoryx_platform/linux/include/iceoryx_platform/time.hpp +++ b/iceoryx_platform/linux/include/iceoryx_platform/time.hpp @@ -18,5 +18,17 @@ #define IOX_HOOFS_LINUX_PLATFORM_TIME_HPP #include +#include + +using iox_clockid_t = clockid_t; + +inline int iox_clock_gettime(iox_clockid_t clk_id, struct timespec* tp) +{ + return clock_gettime(clk_id, tp); +} +inline int iox_gettimeofday(struct timeval* tp, struct timezone* tzp) +{ + return gettimeofday(tp, tzp); +} #endif // IOX_HOOFS_LINUX_PLATFORM_TIME_HPP diff --git a/iceoryx_platform/mac/include/iceoryx_platform/time.hpp b/iceoryx_platform/mac/include/iceoryx_platform/time.hpp index 7269fc9fcb1..b69e55462e7 100644 --- a/iceoryx_platform/mac/include/iceoryx_platform/time.hpp +++ b/iceoryx_platform/mac/include/iceoryx_platform/time.hpp @@ -23,13 +23,16 @@ #include #include +using iox_useconds_t = useconds_t; +using iox_clockid_t = clockid_t; + struct itimerspec { timespec it_interval; timespec it_value; }; -struct appleTimer_t +struct IceoryxPlatformTimer_t { std::thread thread; void (*callback)(union sigval); @@ -48,12 +51,22 @@ struct appleTimer_t } parameter; }; -using timer_t = appleTimer_t*; +using iox_timer_t = IceoryxPlatformTimer_t*; + +int iox_timer_create(iox_clockid_t clockid, struct sigevent* sevp, iox_timer_t* timerid); +int iox_timer_delete(iox_timer_t timerid); +int iox_timer_settime(iox_timer_t timerid, int flags, const struct itimerspec* new_value, struct itimerspec* old_value); +int iox_timer_gettime(iox_timer_t timerid, struct itimerspec* curr_value); +int iox_timer_getoverrun(iox_timer_t timerid); + -int timer_create(clockid_t clockid, struct sigevent* sevp, timer_t* timerid); -int timer_delete(timer_t timerid); -int timer_settime(timer_t timerid, int flags, const struct itimerspec* new_value, struct itimerspec* old_value); -int timer_gettime(timer_t timerid, struct itimerspec* curr_value); -int timer_getoverrun(timer_t timerid); +inline int iox_clock_gettime(iox_clockid_t clk_id, struct timespec* tp) +{ + return clock_gettime(clk_id, tp); +} +inline int iox_gettimeofday(struct timeval* tp, struct timezone* tzp) +{ + return gettimeofday(tp, tzp); +} #endif // IOX_HOOFS_MAC_PLATFORM_TIME_HPP diff --git a/iceoryx_platform/mac/source/time.cpp b/iceoryx_platform/mac/source/time.cpp index 5a2d3dc3f91..3ad883390ac 100644 --- a/iceoryx_platform/mac/source/time.cpp +++ b/iceoryx_platform/mac/source/time.cpp @@ -24,7 +24,7 @@ static std::chrono::nanoseconds getNanoSeconds(const timespec& value) + static_cast(value.tv_nsec)); } -static void stopTimerThread(timer_t timerid) +static void stopTimerThread(iox_timer_t timerid) { timerid->parameter.mutex.lock(); timerid->parameter.keepRunning = false; @@ -37,7 +37,7 @@ static void stopTimerThread(timer_t timerid) } } -static bool waitForExecution(timer_t timerid) +static bool waitForExecution(iox_timer_t timerid) { using timePoint_t = std::chrono::time_point; std::unique_lock ulock(timerid->parameter.mutex); @@ -45,7 +45,7 @@ static bool waitForExecution(timer_t timerid) if (timerid->parameter.isTimerRunning) { timespec waitUntil; - clock_gettime(CLOCK_REALTIME, &waitUntil); + iox_clock_gettime(CLOCK_REALTIME, &waitUntil); waitUntil.tv_sec += timerid->parameter.timeParameters.it_value.tv_sec; waitUntil.tv_nsec += timerid->parameter.timeParameters.it_value.tv_nsec; timerid->parameter.wakeup.wait_until(ulock, timePoint_t(getNanoSeconds(waitUntil)), [timerid] { @@ -62,19 +62,19 @@ static bool waitForExecution(timer_t timerid) } static void -setTimeParameters(timer_t timerid, const itimerspec& timeParameters, const bool runOnce, const bool isTimerRunning) +setTimeParameters(iox_timer_t timerid, const itimerspec& timeParameters, const bool runOnce, const bool isTimerRunning) { std::lock_guard l(timerid->parameter.mutex); - clock_gettime(CLOCK_REALTIME, &timerid->parameter.startTime); + iox_clock_gettime(CLOCK_REALTIME, &timerid->parameter.startTime); timerid->parameter.timeParameters = timeParameters; timerid->parameter.runOnce = runOnce; timerid->parameter.wasCallbackCalled = false; timerid->parameter.isTimerRunning = isTimerRunning; } -int timer_create(clockid_t, struct sigevent* sevp, timer_t* timerid) +int iox_timer_create(iox_clockid_t, struct sigevent* sevp, iox_timer_t* timerid) { - timer_t timer = new appleTimer_t(); + iox_timer_t timer = new IceoryxPlatformTimer_t(); timer->callback = sevp->sigev_notify_function; timer->callbackParameter = sevp->sigev_value; @@ -106,14 +106,14 @@ int timer_create(clockid_t, struct sigevent* sevp, timer_t* timerid) return 0; } -int timer_delete(timer_t timerid) +int iox_timer_delete(iox_timer_t timerid) { stopTimerThread(timerid); delete timerid; return 0; } -int timer_settime(timer_t timerid, int, const struct itimerspec* new_value, struct itimerspec*) +int iox_timer_settime(iox_timer_t timerid, int, const struct itimerspec* new_value, struct itimerspec*) { // disarm timer if (new_value->it_value.tv_sec == 0 && new_value->it_value.tv_nsec == 0) @@ -135,11 +135,11 @@ int timer_settime(timer_t timerid, int, const struct itimerspec* new_value, stru return 0; } -int timer_gettime(timer_t timerid, struct itimerspec* curr_value) +int iox_timer_gettime(iox_timer_t timerid, struct itimerspec* curr_value) { constexpr int64_t NANO_SECONDS{1000000000}; timespec currentTime; - clock_gettime(CLOCK_REALTIME, ¤tTime); + iox_clock_gettime(CLOCK_REALTIME, ¤tTime); int64_t currentTimeNs = currentTime.tv_sec * NANO_SECONDS + currentTime.tv_nsec; int64_t intervalTimeNs{0}, startTimeNs{0}; { @@ -155,7 +155,7 @@ int timer_gettime(timer_t timerid, struct itimerspec* curr_value) return 0; } -int timer_getoverrun(timer_t) +int iox_timer_getoverrun(iox_timer_t) { return 0; } diff --git a/iceoryx_platform/qnx/include/iceoryx_platform/time.hpp b/iceoryx_platform/qnx/include/iceoryx_platform/time.hpp index c27fe6159a0..c7b16f293da 100644 --- a/iceoryx_platform/qnx/include/iceoryx_platform/time.hpp +++ b/iceoryx_platform/qnx/include/iceoryx_platform/time.hpp @@ -18,5 +18,17 @@ #define IOX_HOOFS_QNX_PLATFORM_TIME_HPP #include +#include + +using iox_clockid_t = clockid_t; + +inline int iox_clock_gettime(iox_clockid_t clk_id, struct timespec* tp) +{ + return clock_gettime(clk_id, tp); +} +inline int iox_gettimeofday(struct timeval* tp, struct timezone* tzp) +{ + return gettimeofday(tp, tzp); +} #endif // IOX_HOOFS_QNX_PLATFORM_TIME_HPP diff --git a/iceoryx_platform/unix/include/iceoryx_platform/time.hpp b/iceoryx_platform/unix/include/iceoryx_platform/time.hpp index 5a9c8642bab..21c659cde60 100644 --- a/iceoryx_platform/unix/include/iceoryx_platform/time.hpp +++ b/iceoryx_platform/unix/include/iceoryx_platform/time.hpp @@ -18,5 +18,17 @@ #define IOX_HOOFS_UNIX_PLATFORM_TIME_HPP #include +#include + +using iox_clockid_t = clockid_t; + +inline int iox_clock_gettime(iox_clockid_t clk_id, struct timespec* tp) +{ + return clock_gettime(clk_id, tp); +} +inline int iox_gettimeofday(struct timeval* tp, struct timezone* tzp) +{ + return gettimeofday(tp, tzp); +} #endif // IOX_HOOFS_UNIX_PLATFORM_TIME_HPP diff --git a/iceoryx_platform/win/include/iceoryx_platform/time.hpp b/iceoryx_platform/win/include/iceoryx_platform/time.hpp index 776ac153b63..64969784e7a 100644 --- a/iceoryx_platform/win/include/iceoryx_platform/time.hpp +++ b/iceoryx_platform/win/include/iceoryx_platform/time.hpp @@ -19,7 +19,9 @@ #if defined(__GNUC__) || defined(__GNUG__) #include -#elif defined(_MSC_VER) +#include +#endif + #include "iceoryx_platform/signal.hpp" #include "iceoryx_platform/win32_errorHandling.hpp" #include "iceoryx_platform/windows.hpp" @@ -32,19 +34,23 @@ #include #include +using iox_useconds_t = uint64_t; +using iox_clockid_t = int; + +#if defined(_MSC_VER) + #define CLOCK_REALTIME 0 #define CLOCK_MONOTONIC 1 -using suseconds_t = uint64_t; -using clockid_t = int; - struct itimerspec { timespec it_interval; timespec it_value; }; -struct appleTimer_t +#endif + +struct IceoryxPlatformTimer_t { std::thread thread; void (*callback)(union sigval); @@ -63,16 +69,15 @@ struct appleTimer_t } parameter; }; -using timer_t = appleTimer_t*; +using iox_timer_t = IceoryxPlatformTimer_t*; -int timer_create(clockid_t clockid, struct sigevent* sevp, timer_t* timerid); -int timer_delete(timer_t timerid); -int timer_settime(timer_t timerid, int flags, const struct itimerspec* new_value, struct itimerspec* old_value); -int timer_gettime(timer_t timerid, struct itimerspec* curr_value); -int timer_getoverrun(timer_t timerid); +int iox_timer_create(iox_clockid_t clockid, struct sigevent* sevp, iox_timer_t* timerid); +int iox_timer_delete(iox_timer_t timerid); +int iox_timer_settime(iox_timer_t timerid, int flags, const struct itimerspec* new_value, struct itimerspec* old_value); +int iox_timer_gettime(iox_timer_t timerid, struct itimerspec* curr_value); +int iox_timer_getoverrun(iox_timer_t timerid); -int clock_gettime(clockid_t clk_id, struct timespec* tp); -int gettimeofday(struct timeval* tp, struct timezone* tzp); -#endif +int iox_clock_gettime(iox_clockid_t clk_id, struct timespec* tp); +int iox_gettimeofday(struct timeval* tp, struct timezone* tzp); #endif // IOX_HOOFS_WIN_PLATFORM_TIME_HPP diff --git a/iceoryx_platform/win/source/time.cpp b/iceoryx_platform/win/source/time.cpp index 372f922d5ef..87ac54a0c20 100644 --- a/iceoryx_platform/win/source/time.cpp +++ b/iceoryx_platform/win/source/time.cpp @@ -17,8 +17,6 @@ #include "iceoryx_platform/time.hpp" -#if defined(_MSC_VER) - static std::chrono::nanoseconds getNanoSeconds(const timespec& value) { static constexpr uint64_t NANOSECONDS = 1000000000u; @@ -26,7 +24,7 @@ static std::chrono::nanoseconds getNanoSeconds(const timespec& value) + static_cast(value.tv_nsec)); } -static void stopTimerThread(timer_t timerid) +static void stopTimerThread(iox_timer_t timerid) { timerid->parameter.mutex.lock(); timerid->parameter.keepRunning = false; @@ -39,7 +37,7 @@ static void stopTimerThread(timer_t timerid) } } -static bool waitForExecution(timer_t timerid) +static bool waitForExecution(iox_timer_t timerid) { using timePoint_t = std::chrono::time_point; std::unique_lock ulock(timerid->parameter.mutex); @@ -47,7 +45,7 @@ static bool waitForExecution(timer_t timerid) if (timerid->parameter.isTimerRunning) { timespec waitUntil; - clock_gettime(CLOCK_REALTIME, &waitUntil); + iox_clock_gettime(CLOCK_REALTIME, &waitUntil); waitUntil.tv_sec += timerid->parameter.timeParameters.it_value.tv_sec; waitUntil.tv_nsec += timerid->parameter.timeParameters.it_value.tv_nsec; timerid->parameter.wakeup.wait_until(ulock, timePoint_t(getNanoSeconds(waitUntil)), [timerid] { @@ -64,19 +62,19 @@ static bool waitForExecution(timer_t timerid) } static void -setTimeParameters(timer_t timerid, const itimerspec& timeParameters, const bool runOnce, const bool isTimerRunning) +setTimeParameters(iox_timer_t timerid, const itimerspec& timeParameters, const bool runOnce, const bool isTimerRunning) { std::lock_guard l(timerid->parameter.mutex); - clock_gettime(CLOCK_REALTIME, &timerid->parameter.startTime); + iox_clock_gettime(CLOCK_REALTIME, &timerid->parameter.startTime); timerid->parameter.timeParameters = timeParameters; timerid->parameter.runOnce = runOnce; timerid->parameter.wasCallbackCalled = false; timerid->parameter.isTimerRunning = isTimerRunning; } -int timer_create(clockid_t, struct sigevent* sevp, timer_t* timerid) +int iox_timer_create(iox_clockid_t, struct sigevent* sevp, iox_timer_t* timerid) { - timer_t timer = new appleTimer_t(); + iox_timer_t timer = new IceoryxPlatformTimer_t(); timer->callback = sevp->sigev_notify_function; timer->callbackParameter = sevp->sigev_value; @@ -108,14 +106,14 @@ int timer_create(clockid_t, struct sigevent* sevp, timer_t* timerid) return 0; } -int timer_delete(timer_t timerid) +int iox_timer_delete(iox_timer_t timerid) { stopTimerThread(timerid); delete timerid; return 0; } -int timer_settime(timer_t timerid, int, const struct itimerspec* new_value, struct itimerspec*) +int iox_timer_settime(iox_timer_t timerid, int, const struct itimerspec* new_value, struct itimerspec*) { // disarm timer if (new_value->it_value.tv_sec == 0 && new_value->it_value.tv_nsec == 0) @@ -137,11 +135,11 @@ int timer_settime(timer_t timerid, int, const struct itimerspec* new_value, stru return 0; } -int timer_gettime(timer_t timerid, struct itimerspec* curr_value) +int iox_timer_gettime(iox_timer_t timerid, struct itimerspec* curr_value) { constexpr int64_t NANO_SECONDS{1000000000}; timespec currentTime; - clock_gettime(CLOCK_REALTIME, ¤tTime); + iox_clock_gettime(CLOCK_REALTIME, ¤tTime); int64_t currentTimeNs = currentTime.tv_sec * NANO_SECONDS + currentTime.tv_nsec; int64_t intervalTimeNs{0}, startTimeNs{0}; { @@ -157,13 +155,17 @@ int timer_gettime(timer_t timerid, struct itimerspec* curr_value) return 0; } -int timer_getoverrun(timer_t) +int iox_timer_getoverrun(iox_timer_t) { return 0; } -int clock_gettime(clockid_t clk_id, struct timespec* tp) + +int iox_clock_gettime(iox_clockid_t clk_id, struct timespec* tp) { +#if defined(__GNUC__) || defined(__GNUG__) + return clock_gettime(clk_id, tp); +#elif defined(_MSC_VER) if (clk_id == CLOCK_MONOTONIC) { constexpr int64_t NANO_SECONDS_PER_SECOND = 1000000000; @@ -181,9 +183,10 @@ int clock_gettime(clockid_t clk_id, struct timespec* tp) } errno = EINVAL; return -1; +#endif } -int gettimeofday(struct timeval* tp, struct timezone* tzp) +int iox_gettimeofday(struct timeval* tp, struct timezone* tzp) { // difference in nano seconds between 01.01.1601 (UTC) and 01.01.1970 (EPOCH, unix time) static constexpr uint64_t UTC_EPOCH_DIFF{116444736000000000}; @@ -198,8 +201,6 @@ int gettimeofday(struct timeval* tp, struct timezone* tzp) constexpr uint64_t TEN_MILLISECONDS_IN_NANOSECONDS = 10000000; tp->tv_sec = static_cast((time - UTC_EPOCH_DIFF) / TEN_MILLISECONDS_IN_NANOSECONDS); - tp->tv_usec = static_cast(systemTime.wMilliseconds * 1000); + tp->tv_usec = static_cast(systemTime.wMilliseconds * 1000); return 0; } - -#endif diff --git a/iceoryx_posh/source/runtime/heartbeat.cpp b/iceoryx_posh/source/runtime/heartbeat.cpp index d32cad01142..5e660112413 100644 --- a/iceoryx_posh/source/runtime/heartbeat.cpp +++ b/iceoryx_posh/source/runtime/heartbeat.cpp @@ -54,8 +54,8 @@ uint64_t Heartbeat::milliseconds_since_epoch() noexcept }; IOX_ENSURES_WITH_MSG( - !IOX_POSIX_CALL(clock_gettime)(CLOCK_MONOTONIC, &timepoint).failureReturnValue(-1).evaluate().has_error(), - "An error which should never happen occured during 'clock_gettime'!"); + !IOX_POSIX_CALL(iox_clock_gettime)(CLOCK_MONOTONIC, &timepoint).failureReturnValue(-1).evaluate().has_error(), + "An error which should never happen occured during 'iox_clock_gettime'!"); return units::Duration(timepoint).toMilliseconds(); }