执行定时或者后台函数

Timer timer = new Timer();
 timer.schedule(new Task(), 5 * 1000,5 * 1000);

//不会阻塞哦

原文地址:https://www.cnblogs.com/douyamv/p/4010977.html