# -*- coding: cp936 -*- #python 27 #xiaodeng #http://www.cnblogs.com/fnng/p/3489321.html #在单线程中顺序执行两个循环.一定要一个循环结束后,另一个才能开始.总时间是各个循环运行时间之和 from time import sleep,ctime def loop0(): print ‘loop 0:‘,ctime() sleep(4) def loop1(): print ‘loop 1:‘,ctime() sleep(2) def main(): loop0() loop1() if __name__==‘__main__‘: main() ‘‘‘ loop 0: Thu Nov 05 21:39:56 2015 loop 1: Thu Nov 05 21:40:00 2015 ‘‘‘
时间: 2024-09-29 20:12:35