2018-09-22から1日間の記事一覧
ユーザプログラムを所定時間sleepさせてポーリングする nanosleepを使ってみる。 ソースコード例 #include <stdio.h>#include <time.h> #define MICROSEC (1000)int main(int argc, char *argb[]){ struct timespec req = {0, 10 * MICROSEC}; while(1){ nanosleep(&req, NULL</time.h></stdio.h>…