This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace MemTestPlain | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# by Paul Colby (http://colby.id.au), no rights reserved ;) | |
PREV_TOTAL=0 | |
PREV_IDLE=0 | |
while true; do | |
CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics. | |
unset CPU[0] # Discard the "cpu" prefix. | |
IDLE=${CPU[4]} # Get the idle CPU time. |