fix: using /proc/uptime to correctly calculate uptime in seconds (fixes #264)

This commit is contained in:
Simone Margaritelli
2019-10-13 12:18:35 +02:00
parent 99d7017785
commit 77c16c38f4
2 changed files with 10 additions and 7 deletions

View File

@ -17,6 +17,11 @@ def name():
return _name
def uptime():
with open('/proc/uptime') as fp:
return int(fp.read().split('.')[0])
def mem_usage():
out = subprocess.getoutput("free -m")
for line in out.split("\n"):