different clocks

Class Overview


Core timekeeping facilities.

Three different clocks are available, and they should not be confused:

  • System.currentTimeMillis() is the standard "wall" clock (time and date) expressing milliseconds since the epoch. The wall clock can be set by the user or the phone network (seesetCurrentTimeMillis(long)), so the time may jump backwards or forwards unpredictably. This clock should only be used when correspondence with real-world dates and times is important, such as in a calendar or alarm clock application. Interval or elapsed time measurements should use a different clock. If you are using System.currentTimeMillis(), consider listening to the ACTION_TIME_TICKACTION_TIME_CHANGED and ACTION_TIMEZONE_CHANGED Intent broadcasts to find out when the time changes.

  • uptimeMillis() is counted in milliseconds since the system was booted. This clock stops when the system enters deep sleep (CPU off, display dark, device waiting for external input), but is not affected by clock scaling, idle, or other power saving mechanisms. This is the basis for most interval timing such as Thread.sleep(millls)Object.wait(millis), and System.nanoTime(). This clock is guaranteed to be monotonic, and is suitable for interval timing when the interval does not span device sleep. Most methods that accept a timestamp value currently expect theuptimeMillis() clock.

  • elapsedRealtime() and elapsedRealtimeNanos() return the time since the system was booted, and include deep sleep. This clock is guaranteed to be monotonic, and continues to tick even when the CPU is in power saving modes, so is the recommend basis for general purpose interval timing.

There are several mechanisms for controlling the timing of events:

Summary


Public Methods
static long currentThreadTimeMillis()
Returns milliseconds running in the current thread.
static long elapsedRealtime()
Returns milliseconds since boot, including time spent in sleep.
static long elapsedRealtimeNanos()
Returns nanoseconds since boot, including time spent in sleep.
static boolean setCurrentTimeMillis(long millis)
Sets the current wall time, in milliseconds.
static void sleep(long ms)
Waits a given number of milliseconds (of uptimeMillis) before returning.
static long uptimeMillis()
Returns milliseconds since boot, not counting time spent in deep sleep.
Read Spd Begin... The memory on CH :1 are different! N: pre svc call fun = 0xc2000f04 -- pm-1 = 0, pm-2 = 29819750, pm-3 = 0 N: ddr fun = 0x0 -- pm = 0x29819750, pm2 = 0x0 N: parameter mcu: v0.5 Mcu Start Work ... get_clocks_value: scpi send command start: 0x10 scpi send command success get clocks = 533 MHZ pll_scp_num = 8 Lmu Freq = 1066Mhz ch = 0 parameter set ch closed! DIMM Don't Probed! ch = 1 the dimm info is from uboot... Dimm_Capacity = 8GB Mcu Channel 1 AES configuration begin... AES bypass end... TZC configuration begin... TZC bypass end... use_0x14 == 0xb0100 ctl_cfg_begin...... pi_cfg_begin...... phy_cfg_begin...... fast mode caslat = 15 wrlat = 14 tinit = 856000 r2r_diffcs_dly = 4 r2w_diffcs_dly = 5 w2r_diffcs_dly = 3 w2w_diffcs_dly = 7 r2w_samecs_dly = 4 w2r_samecs_dly = 0 r2r_samecs_dly = 0 w2w_samecs_dly = 0 ch 1 adapter_alg -- 0-0-0-0-0-0-0 rtt_wr = dis rtt_park = 80ohm ron = 34ohm val_cpudrv = 34 rtt_nom = 48ohm val_cpuodt = 48 vref_dev = 10 vrefsel = 0x45 dq_oe_timing = 0x42 rank_num_decode = 1 set phy_indep_init_mode set pi_dram_init_en set_pi_start & ctl_start...... wait init complete...... init complete done...... wait complete done...... rddqs_lat = 0x2 tdfi_phy_rdlat = 0x1f begin software ntp training... rank_num: 0 phy_write_path_lat_add =-1-1-1-1-1-1-1-1-1 phy_write_path_lat_add = 0 0 0 0 0 0 0 0 0 phy_write_path_lat_add = 1 1 1 1 1 1 1 1 1 phy_write_path_lat_add = 2 2 2 2 2 2 2 2 2 phy_write_path_lat_add = 3 3 3 3 3 3 3 3 3 phy_write_path_lat_add = 4 4 4 4 4 4 4 4 4 rank 0 wdqlvl! r2r_diffcs_dly = 4 r2w_diffcs_dly = 7 w2r_diffcs_dly = 4 w2w_diffcs_dly = 6 r2w_samecs_dly = 5 rank 0 ch 1 training fail
06-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值