a
This commit is contained in:
21
SS23/AuD/src/UEB01/StopUhr.java
Normal file
21
SS23/AuD/src/UEB01/StopUhr.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package UEB01;
|
||||
|
||||
public class StopUhr
|
||||
{
|
||||
private long startTime, stopTime;
|
||||
|
||||
public void start()
|
||||
{
|
||||
startTime = System.nanoTime();
|
||||
}
|
||||
|
||||
public void stop()
|
||||
{
|
||||
stopTime = System.nanoTime();
|
||||
}
|
||||
|
||||
public long getDuration()
|
||||
{
|
||||
return stopTime - startTime;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user