Change the display time of exception message magento 2

To change the time please copy this file 

vendor\magento\module-ui\view\frontend\web\js\view\messages.js

to your them to be in this path

app\design\frontend\{vendor}\{theme}\Magento_Ui\web\js\view\messages.js

then modify this function 

 

onHiddenChange: function (isHidden) {
            var self = this;
            // Hide message block if needed
            if (isHidden) {
                setTimeout(function () {
                    $(self.selector).hide('blind', {}, 500)
                }, 5000);
            }
        }