net.ranides.assira.time
Class TimeUtils

java.lang.Object
  extended by net.ranides.assira.time.TimeUtils
Direct Known Subclasses:
TimeHelper

public class TimeUtils
extends Object

Author:
ranides

Field Summary
static long DAY
           
static long HOUR
           
static long MINUTE
           
static long SECOND
           
 
Method Summary
static TimeResult benchmark(int repeats, Runnable function)
           
static long diff(Date from, Date to)
           
static float diff(Date from, Date to, long unit)
           
static String format(Date date, String format, String ddefault)
           
static TimerTask runAfter(int ms, Runnable action)
           
static TimerTask runAfter(int ms, TimerTask action)
           
static TimerTask runAfterUI(int ms, Runnable action)
           
static TimerTask runAfterUI(int ms, TimerTask action)
           
static
<Q> AutoTimerTask<Q>
runRepeat(int count, int delay, Q param, AutoTimerTask<Q> task)
           
static
<Q> AutoTimerTask<Q>
runRepeatUI(int count, int delay, Q param, AutoTimerTask<Q> task)
           
static boolean sleep(int ms)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECOND

public static final long SECOND
See Also:
Constant Field Values

MINUTE

public static final long MINUTE
See Also:
Constant Field Values

HOUR

public static final long HOUR
See Also:
Constant Field Values

DAY

public static final long DAY
See Also:
Constant Field Values
Method Detail

diff

public static long diff(Date from,
                        Date to)

diff

public static float diff(Date from,
                         Date to,
                         long unit)

sleep

public static boolean sleep(int ms)

format

public static String format(Date date,
                            String format,
                            String ddefault)

benchmark

public static TimeResult benchmark(int repeats,
                                   Runnable function)

runAfterUI

public static TimerTask runAfterUI(int ms,
                                   TimerTask action)

runAfterUI

public static TimerTask runAfterUI(int ms,
                                   Runnable action)

runAfter

public static TimerTask runAfter(int ms,
                                 Runnable action)

runAfter

public static TimerTask runAfter(int ms,
                                 TimerTask action)

runRepeat

public static <Q> AutoTimerTask<Q> runRepeat(int count,
                                             int delay,
                                             Q param,
                                             AutoTimerTask<Q> task)

runRepeatUI

public static <Q> AutoTimerTask<Q> runRepeatUI(int count,
                                               int delay,
                                               Q param,
                                               AutoTimerTask<Q> task)


Copyright © 2013. All Rights Reserved.