I want to perform the action at a certain timeout, like fire an event. I figured out how to do every n number of seconds, but not 1.5 seconds. Here is what I have. Please suggest how to handle my case:
void Publish()
{
static int local_time=time(NULL);
int current_time = time (NULL);
if((current_time+PUBLISH_TIMEOUT)>local_time)
{
fireEvent();
local_time=current_time;
}
}