顯示具有 [Linux]函式庫 User space 標籤的文章。 顯示所有文章
顯示具有 [Linux]函式庫 User space 標籤的文章。 顯示所有文章

2025年5月25日 星期日

[Linux] User space 函式庫

●Delay 
#include <unistd.h>
usleep(100000); // 延遲 100,000 微秒 = 100 毫秒

●Delay 
#include <time.h>
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 100 * 1000000L; // 100 毫秒
nanosleep(&ts, NULL);