@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.e("yw","kaishi"+System.currentTimeMillis()); CountDownTimer timer = new CountDownTimer(0, 0) {//输入0,0则直接进入onFinish() @Override public void onTick(long millisUntilFinished) { Log.e("yw","zhongjian"+System.currentTimeMillis()); } @Override public void onFinish() { Log.e("yw","over"+System.currentTimeMillis()); } }; timer.start(); }