Skip to main content
1 of 8
nneonneo
  • 12.6k
  • 8
  • 31
  • 52

Python, 358 bytes

Uses multiprocessing and syscalls to achieve two color CPU graphs!

from time import* from multiprocessing import* A=('0088765456788001234567888765432100888000882222222000') B=('0006543234560000012344444443210000000000000000000000') t=time() f=open('/dev/urandom') def F(n): while 1:T=int(time()-t)%len(A);[sleep,[].count,f.readlines][(n<int(A[T]))+(n<int(B[T]))](1) for i in range(7):Process(target=F,args=(i,)).start() F(7) 

Output from Activity Monitor (OS X 10.9):

Activity Monitor output

Output from MenuMeters:

MenuMeters output

This code assumes you have 8 cores. It should be pretty easy to modify for fewer/more. It is portable to LinXx/UNIS, and should produce the same two-color output for any CPU monitor that can distinguish User from System CPU time.

nneonneo
  • 12.6k
  • 8
  • 31
  • 52