Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

The usleep seems work incorrect.

Hi All,

The usleep seems work incorrect.

int main(argc, argv)

int argc;

char *argv[];

{

unsigned i, idx;

for (i = 0; i<1; i++){

for (idx=0;idx<1000;idx++)

usleep(10000);

}

}

When usleep() setting below 10000 uS (1 to 9999 uS)this program always spent about 20 seconds, and set it to 10000uS spent about 2 seconds, Why?

Please someone help I need using uS delay or sleep in uClinux-NIOSII.

Thanks in advance.

Best regards,
No RepliesBe the first to reply