From 80d6ca22abfa69b462ef34ce209026c3f026e003 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Tue, 21 Jul 2020 00:42:18 +0100 Subject: [PATCH] Removing CPU time --- cogs/help/info.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cogs/help/info.py b/cogs/help/info.py index f75ad71c..62a988fa 100644 --- a/cogs/help/info.py +++ b/cogs/help/info.py @@ -214,29 +214,21 @@ class Info(commands.Cog): proc = Process() with proc.oneshot(): uptime = datetime.timedelta(seconds=time() - proc.create_time()) - cpu = proc.cpu_times() - if cpu: - cpu_time = datetime.timedelta(seconds=cpu.system + cpu.user) mem_total = virtual_memory().total / (1024 ** 2) mem_of_total = proc.memory_percent() mem_usage = mem_total * (mem_of_total / 100) - cpu_hours, cpu_remainder = divmod(cpu_time.seconds, 3600) - cpu_minutes, cpu_seconds = divmod(cpu_remainder, 60) uptime_hours, uptime_remainder = divmod(uptime.seconds, 3600) uptime_minutes, uptime_seconds = divmod(uptime_remainder, 60) frmt_uptime = '{:01} Hours, {:01} Minutes, {:01} Seconds'.format(int(uptime_hours), int(uptime_minutes), int(uptime_seconds)) - frmt_cputime = '{:01} Hours, {:01} Minutes, {:01} Seconds'.format(int(cpu_hours), int(cpu_minutes), - int(cpu_seconds)) # Setting up fields fields = [ ("Developer", "Hamothy#5619", True), ("Bot Version", "1.7.2", False), ("Language | Library", f"Python {python_version()} | Discord.py {discord_version}", False), - ("Uptime", frmt_uptime, True), - ("CPU Time", frmt_cputime, True), + ("Uptime", frmt_uptime, False), ("Memory Usage", f"{mem_usage:,.2f} / {mem_total:,.2f} MiB ({mem_of_total:.2f}%)", False), ("Guilds", f"{len(self.bot.guilds)}", True), ("Users", f"{len(self.bot.users):,}", True)