t544.py 382 B

12345678910111213141516171819
  1. from time import sleep;
  2. class SleepyClass:
  3. def __init__(self):
  4. print "Sleeping in __init__"
  5. print "Sleep returned "+str(sleep(0.01))
  6. def doSleep(self, param):
  7. x = 42
  8. print "Sleeping for .01 seconds"
  9. print "Sleep returned "+str(sleep(0.01))
  10. print "Woke up; x = " + str(x)
  11. print "param = " + str(param)
  12. sleeper = SleepyClass()
  13. sleeper.doSleep(7)