1  #!/usr/bin/python
 2 import multiprocessing,time
 3 
 4 class ClockProcess(multiprocessing.Process):
 5     def __init__(self,value):
 6         super(ClockProcess,self).__init__()
 7         self.value=value
 8 
 9     def run(self):
10         n=5
11         while n>0:
12             print "the time is {}".format(time.ctime())
13             time.sleep(self.value)
14             n-=1
15 
16 p=ClockProcess(3)
17 p.start()
18 
19 while True:
20     time.sleep(2)
21     print "*"*40

 

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2021-08-15
  • 2021-11-01
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-07-24
猜你喜欢
  • 2021-08-24
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
相关资源
相似解决方案