Check out example codes for "java time code". It will help you in understanding the concepts better.

Code Example 1

final long startTime = System.currentTimeMillis();
for (int i = 0; i < length; i++) {
  // Do something
}
final long endTime = System.currentTimeMillis();

System.out.println("Total execution time: " + (endTime - startTime));

Learn ReactJs, React Native from akashmittal.com