温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/os/setPriority
点击访问原文链接

Node os.setPriority function | API Reference | Bun

Node os.setPriority function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:os/setPriorityFsetPriority

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:os/setPriorityFsetPriority

function

os.setPriorityfunction setPriority(priority: number): void;

Attempts to set the scheduling priority for the process specified by pid. If pid is not provided or is 0, the process ID of the current process is used.

The priority input must be an integer between -20 (high priority) and 19 (low priority). Due to differences between Unix priority levels and Windows priority classes, priority is mapped to one of six priority constants in os.constants.priority. When retrieving a process priority level, this range mapping may cause the return value to be slightly different on Windows. To avoid confusion, set priority to one of the priority constants.

On Windows, setting priority to PRIORITY_HIGHEST requires elevated user privileges. Otherwise the set priority will be silently reduced to PRIORITY_HIGH.

@param priority

The scheduling priority to assign to the process.

function setPriority(pid: number,priority: number): void;

Attempts to set the scheduling priority for the process specified by pid. If pid is not provided or is 0, the process ID of the current process is used.

The priority input must be an integer between -20 (high priority) and 19 (low priority). Due to differences between Unix priority levels and Windows priority classes, priority is mapped to one of six priority constants in os.constants.priority. When retrieving a process priority level, this range mapping may cause the return value to be slightly different on Windows. To avoid confusion, set priority to one of the priority constants.

On Windows, setting priority to PRIORITY_HIGHEST requires elevated user privileges. Otherwise the set priority will be silently reduced to PRIORITY_HIGH.

@param pid

The process ID to set scheduling priority for.

@param priority

The scheduling priority to assign to the process.

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node os.setPriority function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for function node:os.setPriority | Bun