Horje
c fractional sleep Code 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




C

Related
measure time in c Code Example measure time in c Code Example
last element in flutter Code Example last element in flutter Code Example
Make a list in scala Code Example Make a list in scala Code Example
hashmap c Code Example hashmap c Code Example
what is syntax in programming Code Example what is syntax in programming Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7