Java tutorial
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be import android.os.SystemClock; public class Main { private static long sForegroundStartTimeMs; public static void recordForegroundStartTime() { sForegroundStartTimeMs = SystemClock.uptimeMillis(); } }