-1

What is the difference between Thread.sleep() and TimeUnit.SECONDS.sleep()? Thanks,any advice will be appreciated.

Alexis
  • 11
  • 3

1 Answers1

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