timers.h
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:1k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. #ifndef __SYS_TIMERS_H__
  2. #define __SYS_TIMERS_H__
  3. struct timespec {
  4.     time_t  tv_sec;
  5.     long    tv_nsec; 
  6. }; 
  7. #define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   
  8.         (ts)->tv_sec = (tv)->tv_sec;                                    
  9.         (ts)->tv_nsec = (tv)->tv_usec * 1000;                           
  10. }
  11. #define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   
  12.         (tv)->tv_sec = (ts)->tv_sec;                                    
  13.         (tv)->tv_usec = (ts)->tv_nsec / 1000;                           
  14. }
  15. #endif /* !__SYS_TIMERS_H__ */