Giter Club home page Giter Club logo

timerprincekin's Introduction

TimerPrincekin

Android 或者JAVA 用的定时、计时任务执行管理器,直接添加对应任务既可以在指定时间或者间隔时间后执行,无需关注其他,可一次管理多个任务

//必须先start,一般建议放到application中调用,不添加任务也不会有影响,会自动进入阻塞状态,直到有任务添加
TimerPrincekin.start();

//添加定时任务
long time = System.currentTimeMillis()+15*1000;
TimerPrincekin.addTask(new TimerTask(new Date(time),timerTask));

//添加计时任务
TimerPrincekin.addTask(new TimeTask(10*1000,timeTask))

任务默认只执行一次,结束后会被自动从任务列表中移除,需要重新添加

不过可以通过,Task 的setExeCount 设置执行次数,设置参数小于等于0时表示该任务,无限循环执行

移除正在进行的任务
TimerPrincekin.removeTask(task)

移除所有等待任务
TimerPrincekin.removeAllTask()

timerprincekin's People

Contributors

zlgspace avatar

Stargazers

 avatar lingzhiyu avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.