summaryrefslogtreecommitdiff
path: root/FreeFileSync/Source/RealTimeSync/monitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'FreeFileSync/Source/RealTimeSync/monitor.cpp')
-rw-r--r--FreeFileSync/Source/RealTimeSync/monitor.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/FreeFileSync/Source/RealTimeSync/monitor.cpp b/FreeFileSync/Source/RealTimeSync/monitor.cpp
index 3baf7de5..b8b9633a 100644
--- a/FreeFileSync/Source/RealTimeSync/monitor.cpp
+++ b/FreeFileSync/Source/RealTimeSync/monitor.cpp
@@ -10,7 +10,7 @@
#include <zen/file_access.h>
#include <zen/dir_watcher.h>
#include <zen/thread.h>
-#include <zen/tick_count.h>
+//#include <zen/tick_count.h>
#include <wx/utils.h>
#include "../lib/resolve_path.h"
//#include "../library/db_file.h" //SYNC_DB_FILE_ENDING -> complete file too much of a dependency; file ending too little to decouple into single header
@@ -93,14 +93,13 @@ WaitResult waitForChanges(const std::vector<Zstring>& folderPathPhrases, //throw
}
}
- const std::int64_t TICKS_DIR_CHECK_INTERVAL = CHECK_FOLDER_INTERVAL * ticksPerSec(); //0 on error
- TickVal lastCheck = getTicks(); //0 on error
+ auto lastCheck = std::chrono::steady_clock::now();
for (;;)
{
const bool checkDirExistNow = [&]() -> bool //checking once per sec should suffice
{
- const TickVal now = getTicks(); //0 on error
- if (dist(lastCheck, now) >= TICKS_DIR_CHECK_INTERVAL)
+ const auto now = std::chrono::steady_clock::now();
+ if (now >= lastCheck + std::chrono::seconds(CHECK_FOLDER_INTERVAL))
{
lastCheck = now;
return true;
bgstack15