function waitForValue(firstEvent, endingEvent) {
        let fullLoad = timing.vals[endingEvent] - timing.vals[firstEvent];
        return new Promise(function cb(resolve, reject) {
            if (isNaN(parseFloat(fullLoad))) {
                reject("Error getting time");
            }
            if (fullLoad < 0) {
                window.setTimeout(function() {
                    fullLoad =
                        timing.vals[endingEvent] - timing.vals[firstEvent];
                    cb(resolve, reject);
                }, 100);
            } else {
                resolve(fullLoad);
            }
        });
    }
/**
     * This function will try every 100ms to collect the value of the resource.
     * @return {Promise} A Promise that is awaiting a value.
     */
This function will try every 100ms to collect the value of the resource.
@return {Promise} A Promise that is awaiting a value.
This function will try every 100ms to collect the value of the resource . @return { Promise } A Promise that is awaiting a value .
function waitForValue(firstEvent, endingEvent) {
        let fullLoad = timing.vals[endingEvent] - timing.vals[firstEvent];
        return new Promise(function cb(resolve, reject) {
            if (isNaN(parseFloat(fullLoad))) {
                reject("Error getting time");
            }
            if (fullLoad < 0) {
                window.setTimeout(function() {
                    fullLoad =
                        timing.vals[endingEvent] - timing.vals[firstEvent];
                    cb(resolve, reject);
                }, 100);
            } else {
                resolve(fullLoad);
            }
        });
    }
function waitForValue ( firstEvent , endingEvent ) { let fullLoad = timing . vals [ endingEvent ] - timing . vals [ firstEvent ] ; return new Promise ( function cb ( resolve , reject ) { if ( isNaN ( parseFloat ( fullLoad ) ) ) { reject ( "Error getting time" ) ; } if ( fullLoad < 0 ) { window . setTimeout ( function ( ) { fullLoad = timing . vals [ endingEvent ] - timing . vals [ firstEvent ] ; cb ( resolve , reject ) ; } , 100 ) ; } else { resolve ( fullLoad ) ; } } ) ; }
This function will try every 100ms to collect the value of the resource.
This function will try every 100ms to collect the value of the resource .