본문 바로가기

computer science/data structure

성능 측정(Perfomance Measurement)

#include <time.h>

  방법1 방법2
Start timing Start=clock(); Start=time(NULL);
Stop timing Stop=clock(); Stop=time(NULL);
Type returned Clock_t Time_t
Result in seconds Duration = 
((double)(stop-start))/CLOCKS_PER_SEC;
Duration = 
(double) difftime(stop, start);