View difference between Paste ID: HbiCmv7G and ViiSFgnx
SHOW: | | - or go back to the newest paste.
1
    private Date now;
2-
    private long nowMillis;
2+
    private long nowLastUpdate;
3
    
4
    private Date getNow() {
5
    	long nowMillis = System.currentTimeMillis();
6
    	if (now == null || nowMillis - nowLastUpdate >= 60 * 1000) {
7
    		now = new Date();
8
    		nowLastUpdate = nowMillis;
9
    	}
10
    	return now;
11
    }