diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-06-08 02:03:31 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-06-09 02:05:34 +0900 |
| commit | 99cd73c0926f0c07d27777fde2f15816e8040030 (patch) | |
| tree | 7c6a077b0590c49029c76686afb9c2ab1d00bb6d /src/DownloadEngineFactory.cc | |
| parent | 2874f6ab095a30a4d297cdc85fa3730bec41b1c2 (diff) | |
Replace timer facility with chrono lib
Diffstat (limited to 'src/DownloadEngineFactory.cc')
| -rw-r--r-- | src/DownloadEngineFactory.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/DownloadEngineFactory.cc b/src/DownloadEngineFactory.cc index fa350589..fe87507c 100644 --- a/src/DownloadEngineFactory.cc +++ b/src/DownloadEngineFactory.cc @@ -166,22 +166,22 @@ DownloadEngineFactory::newDownloadEngine e.get())); if(op->getAsInt(PREF_AUTO_SAVE_INTERVAL) > 0) { - e->addRoutineCommand - (make_unique<AutoSaveCommand>(e->newCUID(), e.get(), - op->getAsInt(PREF_AUTO_SAVE_INTERVAL))); + e->addRoutineCommand(make_unique<AutoSaveCommand>( + e->newCUID(), e.get(), + std::chrono::seconds(op->getAsInt(PREF_AUTO_SAVE_INTERVAL)))); } if(op->getAsInt(PREF_SAVE_SESSION_INTERVAL) > 0) { - e->addRoutineCommand(make_unique<SaveSessionCommand> - (e->newCUID(), e.get(), - op->getAsInt(PREF_SAVE_SESSION_INTERVAL))); + e->addRoutineCommand(make_unique<SaveSessionCommand>( + e->newCUID(), e.get(), + std::chrono::seconds(op->getAsInt(PREF_SAVE_SESSION_INTERVAL)))); } e->addRoutineCommand(make_unique<HaveEraseCommand> - (e->newCUID(), e.get(), 10)); + (e->newCUID(), e.get(), std::chrono::seconds(10))); { - time_t stopSec = op->getAsInt(PREF_STOP); + auto stopSec = op->getAsInt(PREF_STOP); if(stopSec > 0) { - e->addRoutineCommand(make_unique<TimedHaltCommand>(e->newCUID(), e.get(), - stopSec)); + e->addRoutineCommand(make_unique<TimedHaltCommand>( + e->newCUID(), e.get(), std::chrono::seconds(stopSec))); } } if(op->defined(PREF_STOP_WITH_PROCESS)) { |
