FileDocCategorySizeDatePackage
TimeSlicer.javaAPI DocExample666Sun Dec 12 10:51:32 GMT 2004None

TimeSlicer

public class TimeSlicer extends Thread

Fields Summary
private long
timeslice
Constructors Summary
public TimeSlicer(long milliseconds, int priority)


    this.timeslice = milliseconds;
    this.setPriority(priority);
    // If this is the last thread left, it should not
    // stop the VM from exiting
    this.setDaemon(true);

  
public TimeSlicer(long milliseconds)

    this(milliseconds, 10);
  
public TimeSlicer()

    this(100, 10);
  
Methods Summary
public voidrun()

  
    while (true) {
      try {
        Thread.sleep(timeslice);
      }
      catch (InterruptedException ex) {
      }
    }