If you are using a POSIX compliant compiler then you can use
#include <sys/time.h>
int gettimeofday(struct timeval *tv, struct timezone *tz);
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
Create an object of timeval in your function . Do a diff of tv_usec in
each iteration and break when it become 10 miliseconds.
There might be other optimal solutions also.
Best,
-Saswat
On Wed, 2006-12-20 at 15:32 -0800, 1512 1521 wrote:
> I need to create a for loop for 10ms, how can I calculate 10 ms?
>
> for (i=0,i<??,i++) =>10ms
> ....
> ...
> ...
> for (i=0,i<??,i++) =>10ms
>
>
> ----- Original Message ----
> From: Saurabh Jain <[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Wednesday, December 20, 2006 10:01:47 PM
> Subject: [c-prog] Re: How to make "Mail Client"??
>
>
> --- In [EMAIL PROTECTED] com, "ÇáãÌåÜÜÜÜÜÜ\(2\)ÜÜÜÜÜÜæá"
> <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi,
> >
> > Dear friends,
> > That is my fist time mailling you and want some help.
> >
> > I want a mail client that ask the user to (enter his/her Email
> "From", his/her friend mail "To", the subject of the message"Subject"
> and the message "Message") the mail client should then send the
> message to the friend email the user entered.
>
> Hi,
> try looking at : http://nail. cvs.sourceforge. net/nail/ nail/
> But alas, it is in C....
>
> Hope it helps...
> Saurabh
>
>
>
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>
>