nanoTime? What is it?

It is a Java function used to calculate Elapsed Time.

The main reason why you want to know the elapsed time of the method executions is to identify bottlenecks and long running methods, or simply if you want to let your management see how awesomely fast your methods are.

If you are measuring elapsed time, and you want it to be correct, you must use System.nanoTime().

You cannot use System.currentTimeMillis(), unless you don’t mind your result being wrong.

Calculating Elapsed Time

The main reason why you want to know the elapsed time of the method executions is to identify bottlenecks and long running methods, or simply if you want to let your management see how awesomely fast your methods are.

Difference between nanoTime and CurrentTimeMillis

The purpose of nanoTime is to measure elapsed time, and the purpose of currentTimeMillis is to measure wall-clock time. As these are designed for specific reasons, it is important to choose the right one for your needs. The reason is that no computer’s clock is perfect. It is sometimes off and periodically needs to be corrected. This correction might either happen manually, or in the case of most machines, there’s a process that runs and continually issues small corrections to the system clock or wall-clock. These shifts tend to happen often. Another such correction happens whenever there is a leap second.

Since nanoTime’s purpose is to measure elapsed time, it is unaffected by any of these small corrections. It is what you want to use for calculating elapsed time.

You may think, “So what? This will not matter that much”, to which I say, maybe not, but overall, isn’t correct code just better than incorrect code? Besides, nanoTime is shorter to type anyway.

This has been a very interesting subject and I am learning a lot about this, it is mind boggling.

 

NanoTIMER – Nano-technology in various mechanical-electrical resonators

The NanoTIMER initiative is a first step towards the realization of ‘vibrating’ nano-electro- mechanical processors that, combined with traditional CMOS, could open new alternatives for signal processing in VLSI.

There are a number of companies working on this project, including PHILIPS ELECTRONICS NEDERLAND B.V., a Dutch company, which I have known since my family lived in the Netherlands from 1957-1961.

It is amazing how a small country like the Netherlands are quite big in certain arenas, i.e. building dams, turning water into land.

A polder is a low-lying tract of land enclosed by dikes that form an artificial hydrological entity, meaning it has no connection with outside water other than through manually operated devices.

The Netherlands are also well known for its famous cheese-

Dutch cheeses

Edam cheese with crackers

  • Roomano
  • Vlaskaas – has a firm, yet creamy texture and a sweet, sharp flavor

My wife was born in The Hague, Netherlands, and so her love for cheese has continued through the years, even though her family moved to the USA when she was 6 years young.

The Dutch also have famous soccer (voetbal in the Netherlands) players, i.e. Johan Cruijff, Marco van Basten, Ruud Gullit, Frank Rijkaard, Clarence Seedorf, Dennis Bergkamp, Johan Neeskens, Arjen Robben, Wesley Sneijder and many more.