提交 68a104ad 编写于 作者: E erdgeist

Now measure the time a clean_all_torrents takes

上级 ac57c3d5
......@@ -556,6 +556,7 @@ void clean_all_torrents( void ) {
size_t j;
time_t time_now = NOW;
size_t peers_count;
ot_dword diff; struct timeval tv1, tv2; gettimeofday( &tv1, NULL );
if( time_now <= last_clean_time )
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册