同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Provides time-related structures and functions.
Since:
1.0
Version:
1.0
Provides structures and functions related to the system time. |
gettimeofday (struct timeval *__restrict value, void *__restrict ovalue) |
|
setitimer (int w, const struct itimerval *__restrict value, struct itimerval *__restrict ovalue) |
|
settimeofday (const struct timeval *tv, const struct timezone *tz) |
int getitimer (int w, struct [itimerval](itimerval.md) * old )
Description:
Obtains the value of an intermittent timer.
Parameters:
w | Indicates the timer type. Only ITIMER_REAL is supported. |
old | Indicates the pointer to the timer value. |
Returns:
Returns 0 if the operation is successful; returns -1 and sets errno to a value in the following table if the operation fails.
int gettimeofday (struct [timeval](timeval.md) *__restrict value, void *__restrict ovalue )
Description:
Obtains the system time and time zone.
Parameters:
value | Indicates the pointer to the timeval structure that contains the time. |
ovalue | This parameter is used for compatibility only. |
Attention:
Currently, there is no time zone structure. The return value of ovalue is empty.
Returns:
Returns 0 if the operation is successful; returns -1 and sets errno to a value in the following table if the operation fails.
int setitimer (int w, const struct [itimerval](itimerval.md) *__restrict value, struct [itimerval](itimerval.md) *__restrict ovalue )
Description:
Sets the value for a timer.
Parameters:
w | Indicates the timer type. Currently, only ITIMER_REAL is supported. |
value | Indicates the pointer to the timer value to set. |
ovalue | Indicates the pointer to the original timer value before the current setting, which can be NULL. |
Returns:
Returns 0 if the operation is successful; returns -1 and sets errno to a value in the following table if the operation fails.
int settimeofday (const struct [timeval](timeval.md) * tv, const struct [timezone](timezone.md) * tz )
Description:
Sets the system time and time zone.
Parameters:
tv | Indicates the pointer to the time to set. |
tz | Indicates the pointer to the time zone to set. This parameter is not used yet. |
Attention:
tz is invalid. The time is set internally using clock_settime.
Returns:
Returns 0 if the operation is successful; returns -1 and sets errno to a value in the following table if the operation fails.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。