diff options
| author | Matt Corallo <[email protected]> | 2017-01-20 15:36:13 -0500 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-03-06 18:33:50 -0500 |
| commit | 73296f54d6f0b38fcac627882d2e9480a2bad14a (patch) | |
| tree | 48be0c7e220bd652f941e7cd209c3c85bac304c9 /src/scheduler.cpp | |
| parent | Merge #9906: Disallow copy constructor CReserveKeys (diff) | |
| download | discoin-73296f54d6f0b38fcac627882d2e9480a2bad14a.tar.xz discoin-73296f54d6f0b38fcac627882d2e9480a2bad14a.zip | |
CScheduler boost->std::function, use millisecs for times, not secs
Diffstat (limited to 'src/scheduler.cpp')
| -rw-r--r-- | src/scheduler.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/scheduler.cpp b/src/scheduler.cpp index b01170074..861c1a022 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -104,20 +104,20 @@ void CScheduler::schedule(CScheduler::Function f, boost::chrono::system_clock::t newTaskScheduled.notify_one(); } -void CScheduler::scheduleFromNow(CScheduler::Function f, int64_t deltaSeconds) +void CScheduler::scheduleFromNow(CScheduler::Function f, int64_t deltaMilliSeconds) { - schedule(f, boost::chrono::system_clock::now() + boost::chrono::seconds(deltaSeconds)); + schedule(f, boost::chrono::system_clock::now() + boost::chrono::milliseconds(deltaMilliSeconds)); } -static void Repeat(CScheduler* s, CScheduler::Function f, int64_t deltaSeconds) +static void Repeat(CScheduler* s, CScheduler::Function f, int64_t deltaMilliSeconds) { f(); - s->scheduleFromNow(boost::bind(&Repeat, s, f, deltaSeconds), deltaSeconds); + s->scheduleFromNow(boost::bind(&Repeat, s, f, deltaMilliSeconds), deltaMilliSeconds); } -void CScheduler::scheduleEvery(CScheduler::Function f, int64_t deltaSeconds) +void CScheduler::scheduleEvery(CScheduler::Function f, int64_t deltaMilliSeconds) { - scheduleFromNow(boost::bind(&Repeat, this, f, deltaSeconds), deltaSeconds); + scheduleFromNow(boost::bind(&Repeat, this, f, deltaMilliSeconds), deltaMilliSeconds); } size_t CScheduler::getQueueInfo(boost::chrono::system_clock::time_point &first, |