Skip to content

Instantly share code, notes, and snippets.

@swdream
Created May 5, 2015 10:11
Show Gist options
  • Save swdream/ebc3f7895ce2ba6df964 to your computer and use it in GitHub Desktop.
Save swdream/ebc3f7895ce2ba6df964 to your computer and use it in GitHub Desktop.
Check cpu
import os
import time
import psutil
cpu_time = psutil.cpu_times(True)
cpu_count = len(cpu_time)
a = {"cpu":[]}
a['cpu']['count'] = cpu_count
print "%s" % a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment