Hello all fellow programmers. I'm having a hard time understanding the "time.h" file and it's uses. Currently, I've got a project that is supposed to show the time difference between reading/writing from RAM and reading/writing from disk. My program already performs all 4 functions, I just have to use the "time.h" file to show how long it takes and display it in an external file. So how to you start and stop this "measure of time"? I understand how to convert the number of ticks over to seconds (duh) but I just don't understand how to start and stop timing each function. Can anyone please explain this to me in ENGLISH please? Thanks!
BTW, here were the notes I got on "time.h":
• To determine the amount of time a section of code takes to run, use the
timer = clock(); //clock() returns the time in terms of ticks
timer = clock() - timer; //Gives the elapsed time in ticks
timer /= CLOCKS_PER_SEC;
//Converts ticks to seconds
timer /= 60; //Converts seconds to minutes