首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

三种获取系统时间函数的区别

2012-07-15 
三种获取系统时间函数的差别import android.os.SystemClock三种获取系统时间函数的差别??? SystemClock.c

三种获取系统时间函数的差别

import android.os.SystemClock;

三种获取系统时间函数的差别
??? SystemClock.currentThreadTimeMillis();
??? SystemClock.elapsedRealtime();
??? SystemClock.uptimeMillis();


??? /**
???? * Returns milliseconds since boot, not counting time spent in deep sleep.
???? * <b>Note:</b> This value may get reset occasionally (before it would
???? * otherwise wrap around).
???? *
???? * @return milliseconds of non-sleep uptime since boot.
???? */
??? native public static long uptimeMillis();

??? /**
???? * Returns milliseconds since boot, including time spent in sleep.
???? *
???? * @return elapsed milliseconds since boot.
???? */
??? native public static long elapsedRealtime();
???
??? /**
???? * Returns milliseconds running in the current thread.
???? *
???? * @return elapsed milliseconds in the thread
???? */
??? public static native long currentThreadTimeMillis();

热点排行