diff options
author | Steve Huston <shuston@riverace.com> | 2010-06-17 22:07:42 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2010-06-17 22:07:42 +0000 |
commit | 882705374380bcde34bb554451d09d913a2f75f3 (patch) | |
tree | 7d73b4e4278f2873000003997c9945e5ce035894 /ACE/ace/Time_Value.inl | |
parent | 7199c1212eaeb68644e7abc8b072acaf49286b14 (diff) | |
download | ATCD-882705374380bcde34bb554451d09d913a2f75f3.tar.gz |
ChangeLogTag:Thu Jun 17 21:59:34 UTC 2010 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/Time_Value.inl')
-rw-r--r-- | ACE/ace/Time_Value.inl | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/ACE/ace/Time_Value.inl b/ACE/ace/Time_Value.inl index 73f9285ff2d..40ab4476290 100644 --- a/ACE/ace/Time_Value.inl +++ b/ACE/ace/Time_Value.inl @@ -147,13 +147,21 @@ ACE_Time_Value::msec (void) const return ACE_Utils::truncate_cast<unsigned long> (secs); } -ACE_INLINE void -ACE_Time_Value::msec (ACE_UINT64 &ms) const +ACE_INLINE ACE_UINT64 +ACE_Time_Value::get_msec () const { // ACE_OS_TRACE ("ACE_Time_Value::msec"); - ms = ACE_Utils::truncate_cast<ACE_UINT64> (this->tv_.tv_sec); + ACE_UINT64 ms = ACE_Utils::truncate_cast<ACE_UINT64> (this->tv_.tv_sec); ms *= 1000; ms += (this->tv_.tv_usec / 1000); + return ms; +} + +ACE_INLINE void +ACE_Time_Value::msec (ACE_UINT64 &ms) const +{ + // ACE_OS_TRACE ("ACE_Time_Value::msec"); + ms = this->get_msec (); } ACE_INLINE void @@ -164,6 +172,17 @@ ACE_Time_Value::msec (ACE_UINT64 &ms) /*const*/ tv->msec (ms); } +ACE_INLINE void +ACE_Time_Value::set_msec (const ACE_UINT64 &ms) +{ + // ACE_OS_TRACE ("ACE_Time_Value::msec"); + // Convert millisecond units to seconds; + ACE_UINT64 secs = ms / 1000; + this->tv_.tv_sec = static_cast<long> (secs); + // Convert remainder to microseconds; + this->tv_.tv_usec = static_cast<long>((ms - (secs * 1000)) * 1000); +} + /// Converts from milli-seconds format into Time_Value format. ACE_INLINE void ACE_Time_Value::msec (long milliseconds) |