![](https://images.gutefrage.net/media/default/user/8_nmmslarge.png?v=1551279448000)
![](https://images.gutefrage.net/media/default/user/9_nmmslarge.png?v=1551279448000)
long start = System.getCurrentTimeMillis();
while ( running == true ) { // do nothing }
long end = System.currentTimeMillis();
long time = end - start;
oder mit System.nanoTime()
long start = System.getCurrentTimeMillis();
while ( running == true ) { // do nothing }
long end = System.currentTimeMillis();
long time = end - start;
oder mit System.nanoTime()