mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	
		
			
	
	
		
			22 lines
		
	
	
	
		
			354 B
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			22 lines
		
	
	
	
		
			354 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| 
								 | 
							
								from test_support import verbose
							 | 
						||
| 
								 | 
							
								import timing
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								r = range(100000)
							 | 
						||
| 
								 | 
							
								if verbose:
							 | 
						||
| 
								 | 
							
								    print 'starting...'
							 | 
						||
| 
								 | 
							
								timing.start()
							 | 
						||
| 
								 | 
							
								for i in r:
							 | 
						||
| 
								 | 
							
								    pass
							 | 
						||
| 
								 | 
							
								timing.finish()
							 | 
						||
| 
								 | 
							
								if verbose:
							 | 
						||
| 
								 | 
							
								    print 'finished'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								secs = timing.seconds()
							 | 
						||
| 
								 | 
							
								milli = timing.milli()
							 | 
						||
| 
								 | 
							
								micro = timing.micro()
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if verbose:
							 | 
						||
| 
								 | 
							
								    print 'seconds:', secs
							 | 
						||
| 
								 | 
							
								    print 'milli  :', milli
							 | 
						||
| 
								 | 
							
								    print 'micro  :', micro
							 |