From bf302209bfa84f57840675d89fef80bfb7da51d6 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Fri, 2 Feb 2018 17:23:57 +0000 Subject: [PATCH] expose ros_walltime and ros_steadytime (#73) so we can use these cross platform implementations elsewhere. See e.g. https://github.com/ros/ros_comm/pull/1249 --- include/ros/time.h | 2 ++ src/time.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/ros/time.h b/include/ros/time.h index 5943876..e1b65e9 100644 --- a/include/ros/time.h +++ b/include/ros/time.h @@ -115,6 +115,8 @@ namespace ros ROSTIME_DECL void normalizeSecNSec(uint64_t& sec, uint64_t& nsec); ROSTIME_DECL void normalizeSecNSec(uint32_t& sec, uint32_t& nsec); ROSTIME_DECL void normalizeSecNSecUnsigned(int64_t& sec, int64_t& nsec); + ROSTIME_DECL void ros_walltime(uint32_t& sec, uint32_t& nsec); + ROSTIME_DECL void ros_steadytime(uint32_t& sec, uint32_t& nsec); /********************************************************************* ** Time Classes diff --git a/src/time.cpp b/src/time.cpp index e461f93..42fe366 100644 --- a/src/time.cpp +++ b/src/time.cpp @@ -95,11 +95,7 @@ namespace ros /********************************************************************* ** Cross Platform Functions *********************************************************************/ - /* - * These have only internal linkage to this translation unit. - * (i.e. not exposed to users of the time classes) - */ - void ros_walltime(uint32_t& sec, uint32_t& nsec) + void ros_walltime(uint32_t& sec, uint32_t& nsec) { #ifndef WIN32 #if HAS_CLOCK_GETTIME @@ -221,6 +217,11 @@ namespace ros #endif } + /* + * These have only internal linkage to this translation unit. + * (i.e. not exposed to users of the time classes) + */ + /** * @brief Simple representation of the rt library nanosleep function. */