Packagenet.guttershark.util
Classpublic final class CPU

The CPU class benchmarks the clients computer and provides a fast/med/slow estimate.

The CPU class does not provide details about how many CPU's they have, or he actual clock speed.


Example
Benchmarking client CPU:
 
  CPU.calculate();
  trace(CPU.Speed);
  trace(CPU.Speed == CPU.FAST);
  trace(CPU.Speed == CPU.MEDIUM);
  trace(CPU.Speed == CPU.SLOW);
  trace(CPU.Benchmark);
  

See also

net.guttershark.control.DocumentController


Public Properties
 PropertyDefined by
  Benchmark : Number
[static] The actual benchmark number.
CPU
  Speed : String
[static] The speed identifier.
CPU
Public Methods
 MethodDefined by
  
calculate(maxForFast:int = 45, maxForMedium:int = 80):void
[static] Calculate a benchmark time that gives a fairly accurate number you can use to decide if the client's CPU is fast / med / slow.
CPU
Public Constants
 ConstantDefined by
  FAST : String = "fast"
[static] An Identifier for the Speed property of this class.
CPU
  MEDIUM : String = "medium"
[static] An Identifier for the Speed property of this class.
CPU
  SLOW : String = "slow"
[static] An Identifier for the Speed property of this class.
CPU
Property detail
Benchmarkproperty
public static var Benchmark:Number

The actual benchmark number.

Speedproperty 
public static var Speed:String

The speed identifier. It will be set to one of CPU.FAST || CPU.MEDIUM || CPU.SLOW;

Method detail
calculate()method
public static function calculate(maxForFast:int = 45, maxForMedium:int = 80):void

Calculate a benchmark time that gives a fairly accurate number you can use to decide if the client's CPU is fast / med / slow.

Parameters
maxForFast:int (default = 45) — The maximum benchmark that qualifies the client CPU as FAST.
 
maxForMedium:int (default = 80) — The maximum benchmark that qualifies the client CPU as MEDIUM.
Constant detail
FASTconstant
public static const FAST:String = "fast"

An Identifier for the Speed property of this class.

MEDIUMconstant 
public static const MEDIUM:String = "medium"

An Identifier for the Speed property of this class.

SLOWconstant 
public static const SLOW:String = "slow"

An Identifier for the Speed property of this class.