Вопрос

I added following code to measure to learn how many milliseconds program lasted. The problem is I get 1065 Clocks and 1065 Milli seconds. Is it normal that they are equal? Maybe my equation is wrong which converts clock into milliseconds? Thanks in advance

finishClock = clock();
timeCount = finishClock - startClock ;
printf("Clocks passed: %f\n Milli Seconds passed: %f",timeCount, timeCount*1000/CLOCKS_PER_SEC);
Это было полезно?

Решение

Based on the Tcl References here, they are synonymous:

If the -option argument is -milliseconds, then the command is synonymous with clock milliseconds (see below). This usage is obsolete, and clock milliseconds is to be considered the preferred way of obtaining a count of milliseconds.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top