File tree Expand file tree Collapse file tree 5 files changed +6
-13
lines changed
Expand file tree Collapse file tree 5 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 11#include " later.h"
22#include < Rcpp.h>
3- #include < map>
43#include < queue>
54#include < memory>
65#include " debug.h"
Original file line number Diff line number Diff line change 22#define _THREADUTILS_H_
33
44#include < stdexcept>
5- #include < sys/time.h>
65#include < type_traits>
76
87#include " tinycthread.h"
Original file line number Diff line number Diff line change 11#ifndef _LATER_TIMECONV_H_
22#define _LATER_TIMECONV_H_
33
4- #include <sys/time.h>
54// Some platforms (Win32, previously some Mac versions) use
65// tinycthread.h to provide timespec. Whether tinycthread
76// defines timespec or not, we want it to be consistent for
Original file line number Diff line number Diff line change 11#ifndef _WIN32
22
3- #include < errno.h>
4- #include < sys/time.h>
5-
63#include " timer_posix.h"
74
85int Timer::bg_main_func (void * data) {
Original file line number Diff line number Diff line change 11#ifndef _WIN32
22
3- #include < sys/time.h>
43#include " timestamp.h"
54#include " timeconv.h"
65
@@ -18,32 +17,32 @@ class TimestampImplPosix : public TimestampImpl {
1817 TimestampImplPosix () {
1918 get_current_time (&this ->time );
2019 }
21-
20+
2221 TimestampImplPosix (double secs) {
2322 get_current_time (&this ->time );
24-
23+
2524 this ->time = addSeconds (this ->time , secs);
2625 }
27-
26+
2827 virtual bool future () const {
2928 timespec now;
3029 get_current_time (&now);
3130 return this ->time .tv_sec > now.tv_sec ||
3231 (this ->time .tv_sec == now.tv_sec && this ->time .tv_nsec > now.tv_nsec );
3332 }
34-
33+
3534 virtual bool less (const TimestampImpl* other) const {
3635 const TimestampImplPosix* other_impl = dynamic_cast <const TimestampImplPosix*>(other);
3736 return this ->time .tv_sec < other_impl->time .tv_sec ||
3837 (this ->time .tv_sec == other_impl->time .tv_sec && this ->time .tv_nsec < other_impl->time .tv_nsec );
3938 }
40-
39+
4140 virtual bool greater (const TimestampImpl* other) const {
4241 const TimestampImplPosix* other_impl = dynamic_cast <const TimestampImplPosix*>(other);
4342 return this ->time .tv_sec > other_impl->time .tv_sec ||
4443 (this ->time .tv_sec == other_impl->time .tv_sec && this ->time .tv_nsec > other_impl->time .tv_nsec );
4544 }
46-
45+
4746 virtual double diff_secs (const TimestampImpl* other) const {
4847 const TimestampImplPosix* other_impl = dynamic_cast <const TimestampImplPosix*>(other);
4948 double sec_diff = this ->time .tv_sec - other_impl->time .tv_sec ;
You can’t perform that action at this time.
0 commit comments