mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-22 00:03:20 +01:00
Check whether the browser supports performance.measure/mark before calling them. Fixes https://github.com/cmdr2/stable-diffusion-ui/pull/757
This commit is contained in:
parent
73af7f5481
commit
3ed4d792b3
@ -835,10 +835,13 @@
|
||||
* @memberof Task
|
||||
*/
|
||||
async post(timeout=-1) {
|
||||
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')
|
||||
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')
|
||||
}
|
||||
}
|
||||
|
||||
let jsonResponse = await super.post('/render', timeout)
|
||||
if (typeof jsonResponse?.task !== 'number') {
|
||||
console.warn('Endpoint error response: ', jsonResponse)
|
||||
|
@ -440,7 +440,10 @@ function getUncompletedTaskEntries() {
|
||||
}
|
||||
|
||||
function makeImage() {
|
||||
performance.mark('click-makeImage')
|
||||
if (typeof performance == "object" && performance.mark) {
|
||||
performance.mark('click-makeImage')
|
||||
}
|
||||
|
||||
if (!SD.isServerAvailable()) {
|
||||
alert('The server is not available.')
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user