⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usleep.c

📁 spice中支持多层次元件模型仿真的可单独运行的插件源码
💻 C
字号:
/* $Header: /home/harrison/c/tcgmsg/ipcv4.0/RCS/usleep.c,v 1.1 91/12/06 17:26:20 harrison Exp Locker: harrison $ */#ifdef AIX#include <stdio.h>#include <sys/select.h>#endif#include <sys/types.h>#include <sys/time.h>#ifdef STUPIDUSLEEPvoid USleep(us)     long us;{  int s = us/1000000;  if (s == 0)	s = 1;  (void) sleep(s);}#elsevoid USleep(us)     long us;/*  Sleep for the specified no. of micro-seconds ... uses the timeout  on select ... it seems to be accurate to about a few centiseconds  on a sun.  I don't know how much system resources it eats.*/{  int width=0;  struct timeval timelimit;  timelimit.tv_sec = (int) (us/1000000);  timelimit.tv_usec = (int) (us - timelimit.tv_sec*1000000);  (void) select(width, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0,		&timelimit);}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -