diff options
author | Adam <Adam@anope.org> | 2010-09-10 20:31:31 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-09-10 20:31:31 -0400 |
commit | f00e76d30a86acf0f18bcde5647eedd50de50569 (patch) | |
tree | 04af81a883ea6e71ec36e35a2822487c7f8192c6 /src/main.cpp | |
parent | 9eb7562bee7f2a52cf91b0ab0ebc10351f2a46f2 (diff) |
Added Anope::CurTime to keep us from calling time() everywhere
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index d325cdd06..b7fd536e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -435,17 +435,15 @@ int main(int ac, char **av, char **envp) started = true; /* Set up timers */ - time_t last_check = time(NULL); - ExpireTimer expireTimer(Config->ExpireTimeout, last_check); - UpdateTimer updateTimer(Config->UpdateTimeout, last_check); + time_t last_check = Anope::CurTime; + ExpireTimer expireTimer(Config->ExpireTimeout, Anope::CurTime); + UpdateTimer updateTimer(Config->UpdateTimeout, Anope::CurTime); /*** Main loop. ***/ while (!quitting) { while (!quitting && UplinkSock) { - time_t t = time(NULL); - Log(LOG_DEBUG_2) << "Top of main loop"; if (!readonly && (save_data || shutting_down)) @@ -464,10 +462,10 @@ int main(int ac, char **av, char **envp) break; } - if (t - last_check >= Config->TimeoutCheck) + if (Anope::CurTime - last_check >= Config->TimeoutCheck) { - TimerManager::TickTimers(t); - last_check = t; + TimerManager::TickTimers(Anope::CurTime); + last_check = Anope::CurTime; } /* Process any modes that need to be (un)set */ |