Socialabel

Sunday, November 10, 2013

Menghitung Durasi Timer Proses Python

Menghitung sebuah proses dari python dapat digunakan algorimat sebgai berikut:
 Start_Time  
     Proses:  
 Stop_Time  
 Durasi=Stop_Time - Start_Time

Code:
 import urllib2  
 import time  
 awal = time.time()  
 response = urllib2.urlopen('http://zipruz.com')  
 response.close()  
 akhir = time.time()  
 print "Total Waktu Proses ", akhir- awal, " Detik."  

Output:
 Total Waktu Proses 1.34128689766 Detik.  
Keyword: tesis, seo, timer, time, durasi

9 comments: