From 03a8573a032c098ce4cf4397f184bf18b19ef4d6 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 28 Nov 2020 21:10:19 +0300 Subject: [PATCH] Do not update ServerCpuStat too often. --- telegram-bot-api/telegram-bot-api.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telegram-bot-api/telegram-bot-api.cpp b/telegram-bot-api/telegram-bot-api.cpp index 245e2bd..cdfb4cf 100644 --- a/telegram-bot-api/telegram-bot-api.cpp +++ b/telegram-bot-api/telegram-bot-api.cpp @@ -464,6 +464,9 @@ int main(int argc, char *argv[]) { double now = td::Time::now(); if (now >= next_cron_time) { + if (now >= next_cron_time + 1.0) { + next_cron_time = now; + } next_cron_time += 1.0; ServerCpuStat::update(now); }