diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2010-01-30 14:46:24 +0100 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2010-01-30 14:46:24 +0100 |
commit | 6b8a6442914f0d01fcbb0b23a5ef203fe40fca3f (patch) | |
tree | 6f8fa2bbb2626157eb627631adca2a3fde78af79 | |
parent | 9e5700cfd0f7e67fed6b5b70150f6fe5c6d9af4f (diff) |
use global timer in ServerInfo::Update()
-rw-r--r-- | src/server_info.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server_info.cpp b/src/server_info.cpp index 3d7756f0..ca91401b 100644 --- a/src/server_info.cpp +++ b/src/server_info.cpp @@ -18,6 +18,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ +#include <sys/time.h> #include <iomanip> #include "global.h" @@ -90,11 +91,10 @@ std::basic_string<my_char_t> ServerInfo::Title() void ServerInfo::Update() { - static time_t now = 0, past; - time(&past); - if (past <= now) + static timeval past = { 0, 0 }; + if (Global::Timer.tv_sec <= past.tv_sec) return; - time(&now); + gettimeofday(&past, 0); Mpd.UpdateStats(); w->Clear(); |