A timer or sleep method

Hey experts,

 I am reading data from a file in the following loop:

            int jpegSize = atoi(jpeg_size[i]);
            char* cur_jpeg = new char[jpegSize];

            rtphdr.seq = (unsigned int)(i+1);
            rtphdr.ts = (unsigned int)time(0);
            rtphdr.ssrc = RANDOM_INT;
            char* rtp_header = new char[RTP_HDR_SZ];
            memcpy(rtp_header, &rtphdr, RTP_HDR_SZ);


I want each iteration of the loop (starting from the 2nd one) to be preceded by a 100 ms delay; I guess this can be done by using a timer or a sleep method; I've done this before in java, but I don't know how to do that in C++...any help??
Who is Participating?
Dariusz DziaraConnect With a Mentor ProgrammerCommented:
Dariusz DziaraProgrammerCommented:
I hope you meant Windows platform
mte01Author Commented:

Yes, I am using windows platfrom...in which header file is this Sleep method found??
mte01Author Commented:

I found it...it's <windows.h>...thx for your help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.