All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lejos.utility.Stopwatch Maven / Gradle / Ivy

Go to download

leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2013 it was ported to the LEGO EV3 brick.

The newest version!
package lejos.utility; 

/**
* Elapsed time watch (in milliseconds) 
* To use - construct a new instance. * @author Roger Glassey * version 2 */ public class Stopwatch { /** records system clock time (in milliseconds) when reset() was executed */ private int t0 = (int)System.currentTimeMillis(); /** Reset watch to zero */ public void reset() { t0 = (int)System.currentTimeMillis(); } /** Return elapsed time in milliseconds */ public int elapsed( ) { return (int)System.currentTimeMillis() -t0; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy