@bingoogolapple 2014-09-29 01:32:04发表于 bingoogolapple/ Android

  1. SystemClock.uptimeMillis() // 从开机到现在的毫秒数(手机睡眠的时间不包括在内);
  2. System.currentTimeMillis() // 从1970年1月1日 UTC到现在的毫秒数;
long[] mHits = new long[2];

public static void arraycopy (Object src, int srcPos, Object dst, int dstPos, int length)
Added in API level 1
Copies length elements from the array src, starting at offset srcPos, into the array dst, starting at offset dstPos.
The source and destination arrays can be the same array, in which case copying is performed as if the source elements are first copied into a temporary array and then into the destination array.
the source array to copy the content.
the starting index of the content in src.
the destination array to copy the data into.
the starting index for the copied content in dst.
the number of elements to be copied.
// 数组中所有的值左移动一个位置
System.arraycopy(mHits, 1, mHits, 0, mHits.length - 1);
// 最后一个位置的值为当前时间
mHits[mHits.length - 1] = SystemClock.uptimeMillis();
if (mHits[mHits.length - 1] - mHits[0] <= 500) {