()
return non_idle_sum / total
Returns the current cpuload
Returns the current cpuload
Returns the current cpuload
def cpu_load():
    """
    Returns the current cpuload
    """
    parts0 = _cpu_stat()
    time.sleep(0.1)
    parts1 = _cpu_stat()
    parts_diff = [p1 - p0 for (p0, p1) in zip(parts0, parts1)]
    user, nice, sys, idle, iowait, irq, softirq, steal, _guest, _guest_nice = parts_diff
    idle_sum = idle + iowait
    non_idle_sum = user + nice + sys + irq + softirq + steal
    total = idle_sum + non_idle_sum
    return non_idle_sum / total
def cpu_load ( ) : parts0 = _cpu_stat ( ) time . sleep ( 0.1 ) parts1 = _cpu_stat ( ) parts_diff = [ p1 - p0 for ( p0 , p1 ) in zip ( parts0 , parts1 ) ] user , nice , sys , idle , iowait , irq , softirq , steal , _guest , _guest_nice = parts_diff idle_sum = idle + iowait non_idle_sum = user + nice + sys + irq + softirq + steal total = idle_sum + non_idle_sum return non_idle_sum / total