openharmony 鸿蒙 capi-sleep-h

2026-08-25 浏览 (1)

sleep.h

Overview

The sleep.h file declares the sleep and yield APIs in C.

File to include: <ffrt/sleep.h>

Library: libffrt.z.so

System capability: SystemCapability.Resourceschedule.Ffrt.Core

Since: 10

Related module: FFRT

Summary

Function

NameDescription
FFRT_C_API int ffrt_usleep(uint64_t usec)Sets the fixed sleep time.
FFRT_C_API void ffrt_yield(void)Passes control to other tasks so that they can be executed.

Function Description

ffrt_usleep()

FFRT_C_API int ffrt_usleep(uint64_t usec)

Description

Sets the fixed sleep time.

Since: 10

Parameters

NameDescription
uint64_t usecSleep time, in microseconds.

Returns

TypeDescription
FFRT_C_API intReturns ffrt_success if the sleep time is set;
returns ffrt_error otherwise.

ffrt_yield()

FFRT_C_API void ffrt_yield(void)

Description

Passes control to other tasks so that they can be executed.

Since: 10

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-fiber-h

openharmony 鸿蒙 capi-ffrt-ffrt-mutex-t

openharmony 鸿蒙 capi-ffrt-ffrt-rwlockattr-t

openharmony 鸿蒙 capi-loop-h

openharmony 鸿蒙 Readme-EN

openharmony 鸿蒙 capi-ffrt-ffrt-rwlock-t

openharmony 鸿蒙 capi-shared-mutex-h

openharmony 鸿蒙 capi-ffrt-ffrt-queue-attr-t

openharmony 鸿蒙 capi-ffrt

openharmony 鸿蒙 capi-ffrt-ffrt-fiber-t

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/GLCppb5T