Do not update ServerCpuStat too often.
This commit is contained in:
parent
c31fb577ff
commit
b03f7e488f
1 changed files with 3 additions and 0 deletions
|
|
@ -464,6 +464,9 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
double now = td::Time::now();
|
double now = td::Time::now();
|
||||||
if (now >= next_cron_time) {
|
if (now >= next_cron_time) {
|
||||||
|
if (now >= next_cron_time + 1.0) {
|
||||||
|
next_cron_time = now;
|
||||||
|
}
|
||||||
next_cron_time += 1.0;
|
next_cron_time += 1.0;
|
||||||
ServerCpuStat::update(now);
|
ServerCpuStat::update(now);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue