Changeset 021375b for apps


Ignore:
Timestamp:
Dec 20, 2018 10:58:30 AM (18 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
18b7d97
Parents:
8a06027
Message:

NTCP: More now() calls out of loops

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java

    r8a06027 r021375b  
    289289        out.write(buf.toString());
    290290        buf.setLength(0);
     291        long now = _context.clock().now();
    291292        for (NTCPConnection con : peers) {
    292293            buf.append("<tr><td class=\"cells\" align=\"left\" nowrap>");
     
    307308            buf.append("</td><td class=\"cells peeripv6\" align=\"center\">").append(con.getVersion());
    308309            buf.append("</td><td class=\"cells\" align=\"center\"><span class=\"right\">");
    309             buf.append(DataHelper.formatDuration2(con.getTimeSinceReceive()));
    310             buf.append("</span>").append(THINSP).append("<span class=\"left\">").append(DataHelper.formatDuration2(con.getTimeSinceSend()));
     310            buf.append(DataHelper.formatDuration2(con.getTimeSinceReceive(now)));
     311            buf.append("</span>").append(THINSP).append("<span class=\"left\">").append(DataHelper.formatDuration2(con.getTimeSinceSend(now)));
    311312            buf.append("</span></td><td class=\"cells\" align=\"center\"><span class=\"right\">");
    312             if (con.getTimeSinceReceive() < 2*60*1000) {
     313            if (con.getTimeSinceReceive(now) < 2*60*1000) {
    313314                float r = con.getRecvRate();
    314315                buf.append(formatRate(r / 1000));
     
    318319            }
    319320            buf.append("</span>").append(THINSP).append("<span class=\"left\">");
    320             if (con.getTimeSinceSend() < 2*60*1000) {
     321            if (con.getTimeSinceSend(now) < 2*60*1000) {
    321322                float r = con.getSendRate();
    322323                buf.append(formatRate(r / 1000));
Note: See TracChangeset for help on using the changeset viewer.