user1477955
user1477955

Reputation: 1670

TimeUnit.SECONDS.toMillis

I did not understand the explanation at oracle, what is this piece of code actually doing?

final int maximumDelay = (int) TimeUnit.SECONDS.toMillis(1000);

Upvotes: 21

Views: 19467

Answers (1)

Barend
Barend

Reputation: 17444

It converts 1000 seconds into milliseconds, then truncates the result from long to int.

Upvotes: 42

Related Questions