mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-12-25 08:28:54 +01: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
|
||||
*/
|
||||
async post(timeout=-1) {
|
||||
if (typeof performance == "object" && performance.mark && performance.measure) {
|
||||
performance.mark('make-render-request')
|
||||
if (performance.getEntriesByName('click-makeImage', 'mark').length > 0) {
|
||||
console.log('delay between clicking and making the server request:', performance.measure('diff', 'click-makeImage', 'make-render-request').duration + ' ms')
|
||||
}
|
||||
performance.mark('make-render-request')
|
||||
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.getEntriesByName('diff', 'measure')[0].duration + ' ms')
|
||||
}
|
||||
|
||||
let jsonResponse = await super.post('/render', timeout)
|
||||
|
Loading…
Reference in New Issue
Block a user