Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is sleep() in the time-module and not in threading-module?

Tags:

python

Why is the sleep method (for sleeping a thread for some time) stored in the time-module and not in the threading-module (like in java).

I mean, is it not much more related to thread?

like image 441
Simon Lenz Avatar asked Sep 16 '25 10:09

Simon Lenz


1 Answers

Sleep method in time module is derived from *nix sleep function (in unistd.h). It's not more thread related, it's a general function for stopping the execution of the program (or script)

like image 68
sputnikus Avatar answered Sep 19 '25 07:09

sputnikus