C Sleep(milliseconds) Code Example


Example: c fractional sleep

#define _DEFAULT_SOURCE #include "newSleep.h"  void fracSleep(float sec) {     struct timespec ts;     ts.tv_sec = (int) sec;     ts.tv_nsec = (sec - ((int) sec)) * 1000000000;     nanosleep(&ts,NULL); }  fracSleep(0.5); //Half second delay

Comments

Popular posts from this blog

530 Valid Hostname Is Expected When Setting Up IIS 10 For Multiple Sites

C Perror Example

Converting A String To Int In Groovy