FileDocCategorySizeDatePackage
Timer.javaAPI DocExample1695Mon Jul 23 13:26:56 BST 2007org.apache.struts2.util

Timer

public class Timer extends Object
A bean that can be used to time execution of pages

Fields Summary
long
current
long
start
Constructors Summary
Methods Summary
public longgetTime()



    // Public --------------------------------------------------------
       
        // Return how long time has passed since last check point
        long now = System.currentTimeMillis();
        long time = now - current;

        // Reset so that next time we get from this point
        current = now;

        return time;
    
public longgetTotal()

        // Reset start so that next time we get from this point
        return System.currentTimeMillis() - start;