Python - obtener tiempo al fnalizar hilo, no en su ejecucion

 
Vista:

obtener tiempo al fnalizar hilo, no en su ejecucion

Publicado por Arnoldo (1 intervención) el 08/03/2013 08:58:21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import thread
import time
import timeit
 
t1 = time.time()
t2 = time.time()
t3 = time.time()
t4 = time.time()
listadeimp = []
 
def imp1(b1,t1):
	for x in range(0,b1):
		b1=x*x+7*x+10
		listadeimp.append(b1)
	print(time.time() - t1,"seg")
 
def imp2(c1,t2):
	for x in range(b1,c1):
		c1=x*x+7*x+10
		listadeimp.append(c1)
	print(time.time() - t2,"seg")
 
def imp3(d1,t3):
	for x in range(c1,d1):
		d1=x*x+7*x+10
		listadeimp.append(d1)
	print(time.time() - t3,"seg")
 
def imp4(e1,t4):
	for x in range(d1,e1):
		e1=x*x+7*x+10
		listadeimp.append(e1)
	print(time.time() - t4,"seg")
 
def main():
	global b1,c1,d1,e1,t1,t2,t3,t4
	b1=26
	c1=51
	d1=76
	e1=101
 
	thread.start_new_thread(imp1,(b1,t1))
	thread.start_new_thread(imp2,(c1,t2))
	thread.start_new_thread(imp3,(d1,t3))
	thread.start_new_thread(imp4,(e1,t4))
	print(listadeimp)
 
main()


se que posiblemente sea con la implementacion de isAlive ... pero podrian ayudarme? ya intente de muchas formas
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder