diff options
author | Marcel Smit <msmit@remedy.nl> | 2015-02-17 11:36:39 +0100 |
---|---|---|
committer | Marcel Smit <msmit@remedy.nl> | 2015-02-17 11:36:39 +0100 |
commit | 6b0b5ff56e74519ac6ba2efe84f9592344337ab7 (patch) | |
tree | a84f7bcce2e1e4789ce5a9b05464144b646ac3d3 /ACE/ace/Time_Value.inl | |
parent | f9fcd61495af961bd34032cd43919b4b6e0615d2 (diff) | |
download | ATCD-6b0b5ff56e74519ac6ba2efe84f9592344337ab7.tar.gz |
Added chono support for sleeps and ACE_Time_Values.
* ACE/ace/OS_NS_unistd.h:
* ACE/ace/OS_NS_unistd.inl:
* ACE/ace/Time_Value.h:
* ACE/ace/Time_Value.inl:
Diffstat (limited to 'ACE/ace/Time_Value.inl')
-rw-r--r-- | ACE/ace/Time_Value.inl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ACE/ace/Time_Value.inl b/ACE/ace/Time_Value.inl index eaed073f45d..ae767e16ea2 100644 --- a/ACE/ace/Time_Value.inl +++ b/ACE/ace/Time_Value.inl @@ -96,6 +96,19 @@ ACE_Time_Value::ACE_Time_Value (void) this->set (0, 0); } +template< class Rep, class Period > +ACE_INLINE +ACE_Time_Value::ACE_Time_Value (const std::chrono::duration<Rep, Period>& duration) +{ + std::chrono::seconds const s { + std::chrono::duration_cast<std::chrono::seconds> (duration)}; + + std::chrono::microseconds const usec { + std::chrono::duration_cast<std::chrono::microseconds>( + duration % std::chrono::seconds (1))}; + this->set (s.count (), usec.count ()); +} + ACE_INLINE ACE_Time_Value::ACE_Time_Value (time_t sec, suseconds_t usec) { |