I need to find the difference between two time values when one of them is fetched using System. currentTimeMillis() i.e. it's the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC
and the other one is fetched using System.nanoTime() which implies it is current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds
.
How do I do this?
This is not possible. You have a misunderstanding of the nanotime and its purpose.
From the documentation: