Skip to content

Instantly share code, notes, and snippets.

@ElFeesho
Created December 19, 2015 13:43
Show Gist options
  • Save ElFeesho/dfb8aab78bf9d52c1d54 to your computer and use it in GitHub Desktop.
Save ElFeesho/dfb8aab78bf9d52c1d54 to your computer and use it in GitHub Desktop.
import android.os.SystemClock;
import android.util.Log;
public class ProfileLog {
private static final long startTime = SystemClock.uptimeMillis();
public static void tick()
{
StackTraceElement stackTraceElement = new Exception().getStackTrace()[1];
Log.i("ProfileLog", (SystemClock.uptimeMillis()-startTime)+ "ms at "+ stackTraceElement.getClassName()+" - " +stackTraceElement.getMethodName()+":"+stackTraceElement.getLineNumber());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment