meta.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Harmonbot 作者: Harmon758 项目源码 文件源码
def benchmark(self):
        '''Benchmark'''
        process = psutil.Process()
        memory = process.memory_info().rss / 2 ** 20
        process.cpu_percent()
        embed = discord.Embed(color = clients.bot_color)
        embed.add_field(name = "RAM", value = "{:.2f} MiB".format(memory))
        embed.add_field(name = "CPU", value = "Calculating CPU usage..")
        message, embed = await self.bot.say(embed = embed)
        await asyncio.sleep(1)
        cpu = process.cpu_percent() / psutil.cpu_count()
        embed.set_field_at(1, name = "CPU", value = "{}%".format(cpu))
        await self.bot.edit_message(message, embed = embed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号