private String beautifiedTimeDiff()

in src/main/java/org/apache/sling/discovery/oak/TopologyWebConsolePlugin.java [518:534]


    private String beautifiedTimeDiff(long heartbeatTime) {
        final long diff = System.currentTimeMillis() - heartbeatTime;
        long seconds = (diff/1000);
        if (heartbeatTime<=0) {
            return "n/a";
        } else if (seconds==0) {
            return diff+" millis ago";
        } else if (seconds==1) {
            return "1 second ago";
        } else if (seconds<300) {
            // then print seconds
            return seconds+" seconds ago";
        } else {
            // then print seconds
            return (seconds/60)+" minute ago";
        }
    }