What is the difference between Thread.sleep() and TimeUnit.SECONDS.sleep()? Thanks,any advice will be appreciated.
Asked
Active
Viewed 2,239 times
1 Answers
1
There is no difference (except that Thread#sleep takes a millisecond amount).
(TimeUnit#sleep) is a convenience method that converts time arguments into the form required by the Thread.sleep method.

Thilo
- 257,207
- 101
- 511
- 656