mini-caffe icon indicating copy to clipboard operation
mini-caffe copied to clipboard

time

Open zhly0 opened this issue 7 years ago • 2 comments

@luoyetx thanks for your nice work!the code is really simplified for caffe inference. and there is a question: when I use the time count: clock_t start = clock(); clock_t end = clock(); float time = (float)(end - start) / CLOCKS_PER_SEC; the time I get is about 1000ms,but when I use profiler in the mini-caffe,the time I get is about 250ms,I know the clock() is not so accurate,and the time it get is about twice of profile,but why I get four times?

zhly0 avatar Oct 16 '17 02:10 zhly0

@zhly0 consider to use profiler, see this doc

luoyetx avatar Nov 06 '17 10:11 luoyetx

clock() will sum the time of all threads.

use #include <omp.h> double t1 = omp_get_wtime(); ... double t2 = omp_get_wtime(); printf("time = %.3f seconds\n",t2-t1);

zuoqing1988 avatar May 02 '18 06:05 zuoqing1988