dist/hawtio-utilities.js
function humanizeMilliseconds(value) {
        if (!angular.isNumber(value)) {
            return "XXX";
        }
        var seconds = value / 1000;
        var years = Math.floor(seconds / 31536000);
        if (years) {
            return maybePlural(years, "year");
        }
        var days = Math.floor((seconds %= 31536000) / 86400);
        if (days) {
            return maybePlural(days, "day");
        }
        var hours = Math.floor((seconds %= 86400) / 3600);
        if (hours) {
            return maybePlural(hours, 'hour');
        }
        var minutes = Math.floor((seconds %= 3600) / 60);
        if (minutes) {
            return maybePlural(minutes, 'minute');
        }
        seconds = Math.floor(seconds % 60);
        if (seconds) {
            return maybePlural(seconds, 'second');
        }
        return value + " ms";
    }
function humanizeMilliseconds(value) {
        if (!angular.isNumber(value)) {
            return "XXX";
        }
        var seconds = value / 1000;
        var years = Math.floor(seconds / 31536000);
        if (years) {
            return maybePlural(years, "year");
        }
        var days = Math.floor((seconds %= 31536000) / 86400);
        if (days) {
            return maybePlural(days, "day");
        }
        var hours = Math.floor((seconds %= 86400) / 3600);
        if (hours) {
            return maybePlural(hours, 'hour');
        }
        var minutes = Math.floor((seconds %= 3600) / 60);
        if (minutes) {
            return maybePlural(minutes, 'minute');
        }
        seconds = Math.floor(seconds % 60);
        if (seconds) {
            return maybePlural(seconds, 'second');
        }
        return value + " ms";
    }
function humanizeMilliseconds ( value ) { if ( ! angular . isNumber ( value ) ) { return "XXX" ; } var seconds = value / 1000 ; var years = Math . floor ( seconds / 31536000 ) ; if ( years ) { return maybePlural ( years , "year" ) ; } var days = Math . floor ( ( seconds %= 31536000 ) / 86400 ) ; if ( days ) { return maybePlural ( days , "day" ) ; } var hours = Math . floor ( ( seconds %= 86400 ) / 3600 ) ; if ( hours ) { return maybePlural ( hours , 'hour' ) ; } var minutes = Math . floor ( ( seconds %= 3600 ) / 60 ) ; if ( minutes ) { return maybePlural ( minutes , 'minute' ) ; } seconds = Math . floor ( seconds % 60 ) ; if ( seconds ) { return maybePlural ( seconds , 'second' ) ; } return value + " ms" ; }
Takes a value in ms and returns a human readable
duration
@param value
Takes a value in ms and returns a human readable duration