mirror of
				git://erdgeist.org/opentracker
				synced 2025-11-04 03:43:23 +08:00 
			
		
		
		
	Now measure the time a clean_all_torrents takes
This commit is contained in:
		
							parent
							
								
									ac57c3d5d6
								
							
						
					
					
						commit
						68a104ad2a
					
				@ -556,6 +556,7 @@ void clean_all_torrents( void ) {
 | 
				
			|||||||
  size_t j;
 | 
					  size_t j;
 | 
				
			||||||
  time_t time_now = NOW;
 | 
					  time_t time_now = NOW;
 | 
				
			||||||
  size_t peers_count;
 | 
					  size_t peers_count;
 | 
				
			||||||
 | 
					  ot_dword diff; struct timeval tv1, tv2; gettimeofday( &tv1, NULL );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if( time_now <= last_clean_time )
 | 
					  if( time_now <= last_clean_time )
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
@ -624,6 +625,9 @@ void clean_all_torrents( void ) {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  gettimeofday( &tv2, NULL ); diff = ( tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec;
 | 
				
			||||||
 | 
					  fprintf( stderr, "Cleanup time taken: %u\n", diff );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct { size_t val; ot_torrent * torrent; } ot_record;
 | 
					typedef struct { size_t val; ot_torrent * torrent; } ot_record;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user