diff options
author | erdgeist <> | 2007-10-22 00:57:57 +0000 |
---|---|---|
committer | erdgeist <> | 2007-10-22 00:57:57 +0000 |
commit | 68a104ad2af9ae3a2d2354913951a4a64e347309 (patch) | |
tree | 127f1369f187cfb5066ee8e2fbe3f304dfd63971 /trackerlogic.c | |
parent | ac57c3d5d600c73969ea79ca36f5ca4625532ea7 (diff) |
Now measure the time a clean_all_torrents takes
Diffstat (limited to 'trackerlogic.c')
-rw-r--r-- | trackerlogic.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index 00aec1f..3560834 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -556,6 +556,7 @@ void clean_all_torrents( void ) { | |||
556 | size_t j; | 556 | size_t j; |
557 | time_t time_now = NOW; | 557 | time_t time_now = NOW; |
558 | size_t peers_count; | 558 | size_t peers_count; |
559 | ot_dword diff; struct timeval tv1, tv2; gettimeofday( &tv1, NULL ); | ||
559 | 560 | ||
560 | if( time_now <= last_clean_time ) | 561 | if( time_now <= last_clean_time ) |
561 | return; | 562 | return; |
@@ -624,6 +625,9 @@ void clean_all_torrents( void ) { | |||
624 | } | 625 | } |
625 | } | 626 | } |
626 | } | 627 | } |
628 | |||
629 | gettimeofday( &tv2, NULL ); diff = ( tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec; | ||
630 | fprintf( stderr, "Cleanup time taken: %u\n", diff ); | ||
627 | } | 631 | } |
628 | 632 | ||
629 | typedef struct { size_t val; ot_torrent * torrent; } ot_record; | 633 | typedef struct { size_t val; ot_torrent * torrent; } ot_record; |