Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PerformanceObserver, performance.measure() and performance.mark() #3713

Open
RaisinTen opened this issue May 7, 2024 · 0 comments
Labels

Comments

@RaisinTen
Copy link

It might be worth implementing the PerformanceObserver API as well as the performance.measure() and performance.mark() APIs on the performance object in

"use strict";
const EventTargetImpl = require("../events/EventTarget-impl").implementation;
class PerformanceImpl extends EventTargetImpl {
constructor(globalObject, args, privateData) {
super(globalObject, args, privateData);
this.timeOrigin = privateData.timeOrigin;
this._nowAtTimeOrigin = privateData.nowAtTimeOrigin;
}
now() {
return performance.now() - this._nowAtTimeOrigin;
}
toJSON() {
return { timeOrigin: this.timeOrigin };
}
}
exports.implementation = PerformanceImpl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants