Here you can find the source of infoTimeTaken(final Logger log, final long startTime, final long numItems, final String message, final Object... args)
public static void infoTimeTaken(final Logger log, final long startTime, final long numItems, final String message, final Object... args)
//package com.java2s; //License from project: Apache License import org.slf4j.Logger; public class Main { private static final int MILLIES_PER_SECOND = 1000; public static void infoTimeTaken(final Logger log, final long startTime, final long numItems, final String message, final Object... args) { // NOPMD final double elapsedTimeInSeconds = (((double) System.currentTimeMillis()) - startTime) / MILLIES_PER_SECOND;/*from w ww . j av a 2 s . c o m*/ final double itemsPerSecond = numItems / elapsedTimeInSeconds; final String timeInformation = String.format(" - took %.2f seconds to do %d items at %.2f per second.", elapsedTimeInSeconds, numItems, itemsPerSecond); info(log, message + timeInformation, args); } public static void info(final Logger log, final String message, final Object... args) { log.info(getFormattedMessage(message, args)); } private static String getFormattedMessage(final String message, final Object... args) { String formattedMessage = message; if (args != null && args.length > 0) { formattedMessage = String.format(message, args); } return formattedMessage; } }