Measuring time in C

前端 未结 5 1684
青春惊慌失措
青春惊慌失措 2020-12-14 09:26

I\'m trying to measure some activity in C (Matrix multiplying) and noticed that I should do something like this:

clock_t start = clock();
sleep(3);
clock_t e         


        
5条回答
  •  眼角桃花
    2020-12-14 09:58

    You must use time_t start = time(NULL); and time_t end = time(NULL); to get the correct values.

提交回复
热议问题