Timing in C language <time.h>
-
Hello there, in my currect project im trying to communicate between a server and a client codes that I created between 2 computers with the libraries of winsock2 and windows In order to sync the send and recv functions I am trying using the library time.h but I wish to reset the clock() in a certain area of the code so i could start the count since that point and not since the start of the runtime *This has nothing to do with my homeworks this is a legeit question*
-
Hello there, in my currect project im trying to communicate between a server and a client codes that I created between 2 computers with the libraries of winsock2 and windows In order to sync the send and recv functions I am trying using the library time.h but I wish to reset the clock() in a certain area of the code so i could start the count since that point and not since the start of the runtime *This has nothing to do with my homeworks this is a legeit question*
Quote:
but I wish to reset the clock() in a certain area of the code so i could start the count since that point and not since the start of the runtime
You usually don't do that. Instead, you keep track of your 'zero-time' and subtract it to the current one in order to find out the elapsed interval (You may use difftime[^] for the purpose).