Source:
<code>public synchronized void processNotifies(int timeoutMillis) throws SQLException { waitOnLock(); if (getTransactionState() != TransactionState.IDLE) { return; } if (hasNotifications()) { timeoutMillis = -1; } boolean useTimeout = timeoutMillis > 0; long startTime = 0; int oldTimeout = 0; if (useTimeout) { <START> startTime = System.nanoTime() / (long)1E6; <END> try { oldTimeout = pgStream.getSocket().getSoTimeout(); } catch (SocketException e) { throw new PSQLException(GT.tr("An error occurred while trying to get the socket " + "timeout."), PSQLState.CONNECTION_FAILURE, e); } } try { while (timeoutMillis >= 0 || pgStream.hasMessagePending()) { if (useTimeout && timeoutMillis >= 0) { setSocketTimeout(timeoutMillis); } int c = pgStream.receiveChar(); if (useTimeout && timeoutMillis >= 0) { setSocketTimeout(0); } switch (c) { case 'A': receiveAsyncNotify(); timeoutMillis = -1; continue; case 'E': throw receiveErrorResponse(); case 'N': SQLWarning warning = receiveNoticeResponse(); addWarning(warning); if (useTimeout) { long newTimeMillis = System.nanoTime() / (long)1E6; timeoutMillis += startTime - newTimeMillis; startTime = newTimeMillis; if (timeoutMillis == 0) { timeoutMillis = -1; } } break; default: throw new PSQLException(GT.tr("Unknown Response Type {0}.", (char) c), PSQLState.CONNECTION_FAILURE); } } } catch (SocketTimeoutException ioe) { } catch (IOException ioe) { throw new PSQLException(GT.tr("An I/O error occurred while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe); } finally { if (useTimeout) { setSocketTimeout(oldTimeout); } } }</code><technical_language>startTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());</technical_language>

Target:
public synchronized void processNotifies(int timeoutMillis) throws SQLException { waitOnLock(); if (getTransactionState() != TransactionState.IDLE) { return; } if (hasNotifications()) { timeoutMillis = -1; } boolean useTimeout = timeoutMillis > 0; long startTime = 0; int oldTimeout = 0; if (useTimeout) { startTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); try { oldTimeout = pgStream.getSocket().getSoTimeout(); } catch (SocketException e) { throw new PSQLException(GT.tr("An error occurred while trying to get the socket " + "timeout."), PSQLState.CONNECTION_FAILURE, e); } } try { while (timeoutMillis >= 0 || pgStream.hasMessagePending()) { if (useTimeout && timeoutMillis >= 0) { setSocketTimeout(timeoutMillis); } int c = pgStream.receiveChar(); if (useTimeout && timeoutMillis >= 0) { setSocketTimeout(0); } switch (c) { case 'A': receiveAsyncNotify(); timeoutMillis = -1; continue; case 'E': throw receiveErrorResponse(); case 'N': SQLWarning warning = receiveNoticeResponse(); addWarning(warning); if (useTimeout) { long newTimeMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); timeoutMillis += startTime - newTimeMillis; startTime = newTimeMillis; if (timeoutMillis == 0) { timeoutMillis = -1; } } break; default: throw new PSQLException(GT.tr("Unknown Response Type {0}.", (char) c), PSQLState.CONNECTION_FAILURE); } } } catch (SocketTimeoutException ioe) { } catch (IOException ioe) { throw new PSQLException(GT.tr("An I/O error occurred while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe); } finally { if (useTimeout) { setSocketTimeout(oldTimeout); } } }