mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 00:46:31 +00:00
🆕 clock()函数
This commit is contained in:
@ -27,6 +27,16 @@ int usleep(useconds_t usec)
|
||||
tv_sec : (long int)(usec / 1000000),
|
||||
tv_nsec : (long int)(usec % 1000000) * 1000UL
|
||||
};
|
||||
|
||||
|
||||
return nanosleep(&ts, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 获取系统当前cpu时间
|
||||
*
|
||||
* @return clock_t
|
||||
*/
|
||||
clock_t clock()
|
||||
{
|
||||
return (clock_t)syscall_invoke(SYS_CLOCK, 0,0,0,0,0,0,0,0);
|
||||
}
|
@ -35,4 +35,11 @@ struct timespec
|
||||
* @param rmtp 返回的剩余休眠时间
|
||||
* @return int
|
||||
*/
|
||||
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
|
||||
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
|
||||
|
||||
/**
|
||||
* @brief 获取系统当前cpu时间
|
||||
*
|
||||
* @return clock_t
|
||||
*/
|
||||
clock_t clock();
|
Reference in New Issue
Block a user