public void execute(int hour){ long t1 = System.currentTimeMillis(); while(true){ long t2 = System.currentTimeMillis(); if(t2-t1 > hour*60*60*1000){ break; }else{ //TODO your work } } }
本文共 283 字,大约阅读时间需要 1 分钟。
public void execute(int hour){ long t1 = System.currentTimeMillis(); while(true){ long t2 = System.currentTimeMillis(); if(t2-t1 > hour*60*60*1000){ break; }else{ //TODO your work } } }
转载地址:http://hrjwl.baihongyu.com/