跳至主内容
版本:0.82

性能 🧪

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

Canary 🧪

此 API 当前仅在 React Native 的 Canary 和 Experimental 频道中可用。

如果你想试用,请在你的应用中启用 Canary 频道。

全局的 performance 对象,遵循 Web 规范定义。


参考

实例属性​

eventCounts​

参见 MDN 文档。

memory​

参见 MDN 文档。

rnStartupTiming ⚠️​

非标准

此为 React Native 特有的扩展。

提供应用程序启动时间信息。

ts
get rnStartupTiming(): ReactNativeStartupTiming;

ReactNativeStartupTiming 接口包含以下字段:

NameTypeDescription
startTimenumber | voidWhen the React Native runtime initialization was started.
executeJavaScriptBundleEntryPointStartnumber | voidWhen the execution of the application bundle was started.
endTimenumber | voidWhen the React Native runtime was fully initialized.

timeOrigin​

部分支持

提供从 UNIX 纪元到系统启动的毫秒数(而非从 UNIX 纪元到应用启动的毫秒数)。

参见 MDN 文档。

实例方法​

clearMarks()​

参见 MDN 文档。

clearMeasures()​

参见 MDN 文档。

getEntries()​

参见 MDN 文档。

getEntriesByName()​

参见 MDN 文档。

getEntriesByType()​

参见 MDN 文档。

mark()​

参见 MDN 文档。

measure()​

参见 MDN 文档。

now()​

部分支持

提供从系统启动开始的毫秒数(而非从应用启动开始的毫秒数)。

参见 MDN 文档。