Here you can find the source of showElapsed(long start, long end, Context ctx)
public static void showElapsed(long start, long end, Context ctx)
//package com.java2s; import java.math.BigDecimal; import android.content.Context; import android.util.Log; public class Main { public static void showElapsed(long start, long end, Context ctx) { /*if (end - start < 1000) { return;//from w ww .j a v a2 s. co m } Toast.makeText(ctx, "Request took " + getElapsedSeconds(start, end) + " seconds to execute", Toast.LENGTH_SHORT).show();*/ Log.i("ElapsedTimeUtil", "Request took " + getElapsedSeconds(start, end) + " seconds to execute"); } public static double getElapsedSeconds(long start, long end) { BigDecimal seconds = new BigDecimal(end - start) .divide(new BigDecimal(1000)); return seconds.doubleValue(); } }