forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optionally use CLOCK_BOOTTIME for monotonic time
- Loading branch information
Showing
4 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <DCPS/DdsDcps_pch.h> // Only the _pch include should start with DCPS/ | ||
|
||
#include "TimeTypes.h" | ||
|
||
#include <ace/os_include/os_time.h> | ||
|
||
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL | ||
namespace OpenDDS { | ||
namespace DCPS { | ||
|
||
#if OPENDDS_CONFIG_MONOTONIC_USES_BOOTTIME | ||
|
||
ACE_Time_Value_T<BootTimePolicy> BootTimePolicy::operator()() const | ||
{ | ||
timespec ts; | ||
if (0 == ::clock_gettime(CLOCK_BOOTTIME, &ts)) { | ||
return ACE_Time_Value_T<BootTimePolicy>(ts); | ||
} | ||
|
||
return ACE_Time_Value_T<BootTimePolicy>(ACE_Time_Value::zero); | ||
} | ||
|
||
#endif | ||
|
||
} | ||
} | ||
OPENDDS_END_VERSIONED_NAMESPACE_DECL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters