我正在尝试测量在不同国家/地区的用户设备上的反应本机应用程序中加载图像需要多长时间。
\n\n在调试模式下, Performance.now() 创建时间戳,然后将其作为事件的属性发送到 Amplitude。
\n\n但 Performance.now() 是一个 JS 方法,在 Release 版本中不提供给用户。有一个未记录的 global.nativePerformanceNow 方法
\n\n const loadStartAmplitudeEvent = () => {\n if (R.not(__DEV__)) {\n const timeStamp = global.nativePerformanceNow();\n amplitude.logEvent(\'Photo On Load Start\', {\n uri, timeStamp,\n });\n }\n };\nRun Code Online (Sandbox Code Playgroud)\n\n例如,这就是我创建一个带有时间戳的事件以发送到幅度的方法,但我收到错误,我做错了什么?多谢!我应该使用其他方法吗?global.nativePerformanceNow \xe2\x86\x92 g.nativePerformanceNow 转换是否搞砸了?
\n\n2019-08-06 03:10:45.134 [error][tid:com.facebook.react.JavaScript]\ng.nativePerformanceNow is not a function. \n(In \'g.nativePerformanceNow()\', \'g.nativePerformanceNow\' is undefined)\nRun Code Online (Sandbox Code Playgroud)\n