tinyvm.rcx
Class Time

java.lang.Object
  |
  +--tinyvm.rcx.Time

public class Time
extends Object

Implements currentTimeMillis() and sleep() (as sleep wont work in the Thread class).

Author:
Ryan VanderBijl

Method Summary
static int currentTimeMillis()
          Return the number of milliseconds the RCX has been running.
static void sleep(int milli)
          Cause the calling thread to "sleep" for at LEAST the specified number of milliseconds.
 
Methods inherited from class java.lang.Object
getClass, toString
 

Method Detail

currentTimeMillis

public static final int currentTimeMillis()
Return the number of milliseconds the RCX has been running. Warning: this variable will wrap around after approx 49.7 days of continuous operation. However, a more important bug is that you will need new batteries before then. (unless you have RIS v1.0, and use the adapter).

sleep

public static void sleep(int milli)
Cause the calling thread to "sleep" for at LEAST the specified number of milliseconds. Due to thread dispatching algorithm, it may sleep for longer. Native sleep will be implemented in leJOS. This is not busy waitting. (We call Thread.yield()).