Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

measure time in c

void timeWait (float threshold) {
    float timeInitial, timeMeasured, timeDelta = 0;

    timeInitial = (float)clock();
    while (timeDelta < threshold) {
        timeMeasured = (float)clock();
        timeDelta = ((timeMeasured - timeInitial) / (float)CLOCKS_PER_SEC);
    }
    printf("%.2f - %.2f s have passed.", threshold, timeDelta);
}
 
PREVIOUS NEXT
Tagged: #measure #time
ADD COMMENT
Topic
Name
8+9 =