Many languages have a getTickCount()
, getFrequency()
and sleep(ms)
functions - you can string them together pretty easily as:
while (doMoreQueries)
{
startTick = getTickCount();
// send query, do other things
remainingMs = 10000 - (getTickCount() - startTick) * 1000 / getFrequency();
sleep(remainingMs);
}
Although I'm not familiar with Julia, in C++ you could look at using some of the features in chrono, with a sleep function like this.