zoukankan      html  css  js  c++  java
  • android定时器

    Timers schedule one-shot or recurring tasks for execution;

    When a timer is no longer needed, users should call cancel(), which releases the timer's thread and other resources. Timers not explicitly cancelled may hold resources indefinitely。

    定时器会定期执行我们的task线程:

      定时器周期由 task执行时间与定时器设定设定时间中大的决定。

      如果task被某个定时占用了,那么这时不能将它指定到其他定时器。

    释放定时器资源:

      cancel();调用这个函数之后就无法再使用该定时器了。

      purge();这个函数释放被cancel了的task,给其他定时器使用。  

  • 相关阅读:
    wf(三)
    WF(二)
    WF4.0入门(一)
    枚举
    函数和立即函数
    对象字面量
    Break和continue语句
    对象
    循环语句
    条件分支语句(SWICH语句)
  • 原文地址:https://www.cnblogs.com/Empenguin/p/2955861.html
Copyright © 2011-2022 走看看