FileDocCategorySizeDatePackage
TimeSlicer.javaAPI DocExample662Sat Sep 09 19:53:28 BST 2000None

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 e) {
      }
    }