You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					23 lines
				
				378 B
			
		
		
			
		
	
	
					23 lines
				
				378 B
			| 
								 
											6 years ago
										 
									 | 
							
								#!/usr/bin/env python3
							 | 
						||
| 
								 | 
							
								import time
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								from common.realtime import sec_since_boot, monotonic_time
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if __name__ == "__main__":
							 | 
						||
| 
								 | 
							
								    N = 100000
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    t = time.time()
							 | 
						||
| 
								 | 
							
								    for _ in range(N):
							 | 
						||
| 
								 | 
							
								        monotonic_time()
							 | 
						||
| 
								 | 
							
								    dt = time.time() - t
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    print("Monotonic", dt)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    t = time.time()
							 | 
						||
| 
								 | 
							
								    for _ in range(N):
							 | 
						||
| 
								 | 
							
								        sec_since_boot()
							 | 
						||
| 
								 | 
							
								    dt = time.time() - t
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    print("Boot", dt)
							 |