Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- msDelay = Long.parseLong(args.get(2)) - System.currentTimeMillis();
- //inside a listener
- new java.util.Timer().schedule(
- new java.util.TimerTask() {
- @Override
- public void run() {
- mySyncMethod();
- }
- },
- msDelay
- );
- void schedule(TimerTask task, Date time)
- Schedules the specified task for execution at the specified time.
- void schedule(TimerTask task, long delay)
- Schedules the specified task for execution after the specified delay.
- long millis = 123456780000;
- Calendar calendar = Calendar.getInstance();
- calendar.setTimeInMillis(millis);
- Date date = calendar.getTime();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement