You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
Adds support for measuring performance/elapsed time in millisecond precision using Chrono with `performance.now()` in Worklets.
## Changes
- Inject `_chronoNow` func in global runtime object
<!--
## Screenshots / GIFs
Here you can add screenshots / GIFs documenting your change.
You can add before / after section if you're changing some behavior.
### Before
### After
-->
## Test code and steps to reproduce
```ts
runOnUI(() => {
'worklet'
const start = performance.now()
for (let i = 0; i < 1000000; i++) {}
const end = performance.now()
console.log(`Loop took ${end - start} ms!`)
})()
```
## Checklist
- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
## Related Issues
* facebook/react-native#32695
0 commit comments