mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-11 04:58:29 +02:00
Not all browsers return the PerformanceEntry object on performance.measure(). Fix credit @JeLuf
This commit is contained in:
parent
fb0c9405cf
commit
1da4b3d94a
@ -839,11 +839,10 @@
|
|||||||
* @memberof Task
|
* @memberof Task
|
||||||
*/
|
*/
|
||||||
async post(timeout=-1) {
|
async post(timeout=-1) {
|
||||||
if (typeof performance == "object" && performance.mark && performance.measure) {
|
performance.mark('make-render-request')
|
||||||
performance.mark('make-render-request')
|
if (performance.getEntriesByName('click-makeImage', 'mark').length > 0) {
|
||||||
if (performance.getEntriesByName('click-makeImage', 'mark').length > 0) {
|
performance.measure('diff', 'click-makeImage', 'make-render-request')
|
||||||
console.log('delay between clicking and making the server request:', performance.measure('diff', 'click-makeImage', 'make-render-request').duration + ' ms')
|
console.log('delay between clicking and making the server request:', performance.getEntriesByName('diff', 'measure')[0].duration + ' ms')
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let jsonResponse = await super.post('/render', timeout)
|
let jsonResponse = await super.post('/render', timeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user