/*** * Constructs a NTP timestamp object and initializes it so that * it represents the time at which it was allocated, measured to the * nearest millisecond. * @return NTP timestamp object set to the current time. * @see java.lang.System#currentTimeMillis() */ public static TimeStamp getCurrentTime() { return getNtpTime(System.currentTimeMillis()); }
/*** * Constructs a NTP timestamp object and initializes it so that * it represents the time at which it was allocated, measured to the * nearest millisecond. * @return NTP timestamp object set to the current time. * @see java.lang.System#currentTimeMillis() */ public static TimeStamp getCurrentTime() { return getNtpTime(System.currentTimeMillis()); }
/*** * Constructs a NTP timestamp object and initializes it so that * it represents the time at which it was allocated, measured to the * nearest millisecond. * @return NTP timestamp object set to the current time. * @see java.lang.System#currentTimeMillis() */ public static TimeStamp getCurrentTime() { return getNtpTime(System.currentTimeMillis()); }
@Override public Long getSerializableComparable() { return TimeStamp.getNtpTime(timestamp()).getDate().getTime(); } }
public void estimateRtt(long receiptDate, long lastSR, long delaySinceSR) { TimeStamp receiptNtp = TimeStamp.getNtpTime(receiptDate); long receiptNtpTime = NtpUtils.calculateLastSrTimestamp(receiptNtp.getSeconds(), receiptNtp.getFraction()); long delay = receiptNtpTime - lastSR - delaySinceSR; this.roundTripDelay = (delay > 4294967L) ? RTP_SEQ_MOD : (int) ((delay * 1000L) >> 16); if(logger.isTraceEnabled()) { logger.trace("rtt=" + receiptNtpTime + " - " + lastSR + " - " + delaySinceSR + " = " + delay + " => " + this.roundTripDelay + "ms"); } }
public void estimateRtt(long receiptDate, long lastSR, long delaySinceSR) { TimeStamp receiptNtp = TimeStamp.getNtpTime(receiptDate); long receiptNtpTime = NtpUtils.calculateLastSrTimestamp(receiptNtp.getSeconds(), receiptNtp.getFraction()); long delay = receiptNtpTime - lastSR - delaySinceSR; this.roundTripDelay = (delay > 4294967L) ? RTP_SEQ_MOD : (int) ((delay * 1000L) >> 16); if(logger.isTraceEnabled()) { logger.trace("rtt=" + receiptNtpTime + " - " + lastSR + " - " + delaySinceSR + " = " + delay + " => " + this.roundTripDelay + "ms"); } }