code: public double getCpuLoadAvg()
    {
      double avg = _cpuLoadAvg;
      long time = _cpuSetTime;
  
      long now = CurrentTime.currentTime();
  
      if (now - time < 10000L)
        return avg;
      else
        return avg * 10000L / (now - time);
    }
docs: Gets the CPU load avg