Class CPU

java.lang.Object
  |
  +--Device
        |
        +--CPU

class CPU
extends Device

A CPU is a specific kind of Device. It differs from the generic device only in that there is a 1ms delay in starting a process and a 1ms delay in stopping a process. The "current job" is always null.


Fields inherited from class Device
currentJob, name, nextInterruptTime, running, startedAt, totalTime, trace
 
Constructor Summary
(package private) CPU(java.lang.String name)
          Initialize the device.
 
Method Summary
 void start(Job j, int delay)
          Start the CPU running a job.
 
Methods inherited from class Device
current, isBusy, nextInterrupt, printStats, stop, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Constructor Detail

CPU

CPU(java.lang.String name)
Initialize the device.
Parameters:
name - the name of the device.
Method Detail

start

public void start(Job j,
                  int delay)
Start the CPU running a job.
Overrides:
start in class Device
Parameters:
j - the job to run
delay - the time to run the job (in milliseconds). The actual time until the completion interrupt with be Sim.SWAP_OVERHEAD longer than this.