Horje
java measure execution time Code Example
java execution time
long start = System.currentTimeMillis();
class.method();
long time = System.currentTimeMillis() - start;
java get excectuon time
long startTime = System.nanoTime();
methodToTime();
long endTime = System.nanoTime();

long duration = (endTime - startTime);  //divide by 1000000 to get milliseconds.
java execution time

long startTime = System.nanoTime();
myCall(); 
long stopTime = System.nanoTime();
System.out.println(stopTime - startTime);

java measure execution time
Instant start = Instant.now();
Thread.sleep(63553);
Instant end = Instant.now();
System.out.println(Duration.between(start, end)); // prints PT1M3.553S




Java

Related
how to print float in java Code Example how to print float in java Code Example
taking date as input in java Code Example taking date as input in java Code Example
java execute funtions at same time Code Example java execute funtions at same time Code Example
how to clear activity stack in android Code Example how to clear activity stack in android Code Example
android hide textview Code Example android hide textview Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7