I am trying to implement an ETA feature Using System.nanoTime()
startTime = System.nanoTime()
Long elapsedTime = System.nanoTime() - startTime;
Long allTimeForDownloading = (elapsedTime * allBytes / downloadedBytes);
Long remainingTime = allTimeForDownloading - elapsedTime;
But I cannot figure how to get a human readable form of the nanoseconds; for example: 1d 1h, 36s and 3m 50s.
How can I do this?