public void print(TorrentSessionState sessionState){
  if (shutdown) {
    return;
  }
  try {
    long downloaded=sessionState.getDownloaded();
    long uploaded=sessionState.getUploaded();
    graphics.putString(0,2,getDurations(downloaded - this.downloaded,sessionState.getPiecesRemaining(),sessionState.getPiecesTotal()));
    graphics.putString(0,3,getSessionInfo(sessionState.getConnectedPeers(),downloaded - this.downloaded,uploaded - this.uploaded));
    graphics.putString(0,4,getProgressBar(sessionState.getPiecesTotal(),sessionState.getPiecesRemaining()));
    if (sessionState.getPiecesRemaining() == 0) {
      graphics.putString(0,5,"Download is complete. Press Ctrl-C to stop seeding and exit.");
    }
    screen.refresh(Screen.RefreshType.DELTA);
    this.downloaded=downloaded;
    this.uploaded=uploaded;
  }
 catch (  Throwable e) {
    LOGGER.error("Unexpected error when printing session state",e);
    shutdown();
  }
}

public void print ( TorrentSessionState sessionState ) { if ( shutdown ) { return ; } try { long downloaded = sessionState . getDownloaded ( ) ; long uploaded = sessionState . getUploaded ( ) ; graphics . putString ( 0 , 2 , getDurations ( downloaded - this . downloaded , sessionState . getPiecesRemaining ( ) , sessionState . getPiecesTotal ( ) ) ) ; graphics . putString ( 0 , 3 , getSessionInfo ( sessionState . getConnectedPeers ( ) , downloaded - this . downloaded , uploaded - this . uploaded ) ) ; graphics . putString ( 0 , 4 , getProgressBar ( sessionState . getPiecesTotal ( ) , sessionState . getPiecesRemaining ( ) ) ) ; if ( sessionState . getPiecesRemaining ( ) == 0 ) { graphics . putString ( 0 , 5 , "Download is complete. Press Ctrl-C to stop seeding and exit." ) ; } screen . refresh ( Screen . RefreshType . DELTA ) ; this . downloaded = downloaded ; this . uploaded = uploaded ; } catch ( Throwable e ) { LOGGER . error ( "Unexpected error when printing session state" , e ) ; shutdown ( ) ; } }
call me once per second
