blog/content/post/2009/05/24/2009-05-24-00001161.md

1.7 KiB
Raw Blame History

title author date url wordtwit_post_info categories
実行時間の測定 kazu634 2009-05-24 /2009/05/24/_1252/
O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:4611;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}
C

気になったのでメモしておきますね:

#include <sys/time.h>

double gettimeofday_sec(){

struct timeval t;

gettimeofday(&t, NULL);

return (double)t.tv_sec + (double)t.tv_usec * 1e-6;

}

    

int main(){

double tstart, tend;

tstart = gettimeofday_sec(); //開始時間取得

/*処理*/

tend = gettimeofday_sec(); //終了時間取得

printf(“%10.20f”,tend tstart); //処理時間表示

}

実行時間測定方法 情報系女子大生の一歩先へ