5 threads, each sleeps 3 second in parallel,threadssleeps,import threa
文章由Byrx.net分享于2019-03-23 07:03:27
5 threads, each sleeps 3 second in parallel,threadssleeps,import threa
import thread, timedef counter(myId, count): for i in range(count): time.sleep(1) print 'thread number %d reporting in at %d...' % (myId, time.clock())print time.clock()for i in range(5): thread.start_new(counter, (i, 3))time.sleep(5) print 'Main thread exiting.'
相关内容
- Split a string by ',',splitstringby,line = 'bob,
- Checkbutton to set font to bold,checkbuttonbold,from Tkinter
- Draw lines,drawlines,from Tkinter
- Line width,linewidth,from Tkinter
- Adding Elements to Lists,addinglists,li = ['a', '
- Concatenation ( + ),concatenation,num_list = [
- List membership demo,membershipdemo,print 3 in [
- List value assignment and index reference,,L1 = [2,3,4]
- List: display one item through an index,displayitem,inventory =
- Tuple concatenation,tupleconcatenation,print (1, 2)
评论关闭