diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:14:37 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:14:37 +0200 |
commit | 8bf668665b107469086f16cb8ad23e47d479d2b4 (patch) | |
tree | 66a91ef06a8caa7cd6819dcbe1860693d3eda8d5 /library/status_handler.cpp | |
parent | 3.21 (diff) | |
download | FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.tar.gz FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.tar.bz2 FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.zip |
4.0
Diffstat (limited to 'library/status_handler.cpp')
-rw-r--r-- | library/status_handler.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/library/status_handler.cpp b/library/status_handler.cpp index 9c2fdd67..55f82c64 100644 --- a/library/status_handler.cpp +++ b/library/status_handler.cpp @@ -6,8 +6,7 @@ #include "status_handler.h" #include <wx/app.h> -#include <wx/timer.h> - +#include <ctime> void updateUiNow() { @@ -21,12 +20,14 @@ void updateUiNow() bool updateUiIsAllowed() { - static wxMilliClock_t lastExec = 0; - const wxMilliClock_t newExec = wxGetLocalTimeMillis(); + const std::clock_t CLOCK_UPDATE_INTERVAL = UI_UPDATE_INTERVAL * CLOCKS_PER_SEC / 1000; + + static std::clock_t lastExec = 0; + const std::clock_t now = std::clock(); //this is quite fast: 2 * 10^-5 - if (newExec - lastExec >= UI_UPDATE_INTERVAL) //perform ui updates not more often than necessary + if (now - lastExec >= CLOCK_UPDATE_INTERVAL) //perform ui updates not more often than necessary { - lastExec = newExec; + lastExec = now; return true; } return false; |