Relative Content

Tag Archive for cmacostime

Implementation of an incrementing variable after a specified period of time in C (not c++)

I am learning C and implementing a function where a variable is incremented at a certain period of time. However, I have been unable to find a solution that isn’t dependent on operating system (pthreads) or ones that are for C++ or C#. Additionally, I am unable to find a way that doesn’t use a function like usleep(); because I need to have this running with the rest of the program, not stopping it.