Hi guys. Sorry if this is a regularly posted question, but here goes:
We're currently working on a project for a class based on C programming. Last term, we did the same class, but with MatLab. (I'm not sure if you guys are familiar with the software)
The project that we're assigned this term is to power two 7-segment LED's to reflect elapsed time in seconds. We've searched around, and found "time.h" and the "clock_t" function, but it seems that it only keeps track of time in full seconds? Also, it doesn't seem to have the functionality that we are looking for - we can calculate the difference in time via "difftime(t2-t1)", but in order for this to work effectively, we must calculate the difference constantly.
Right now, we've got a good idea of what the code should look like, but as you can see, we keep running into a wall in regards to measuring time.
The reason I brought up MatLab earlier in the post is because there's a function called tic toc. "tic" starts a timer in MatLab, while "toc" returns a time value since the intial "tic". Is there something in C that is similar to this?
for example, for our last term's project, we did the following:
Thanks for the help!Code:<headers, blah blah blah blah etc> tic while (toc < [set time values]) { do stuff } etc