All Downloads are FREE. Search and download functionalities are using the official Maven repository.

link.jfire.testsupport.time.Timewatch Maven / Gradle / Ivy

The newest version!
package link.jfire.testsupport.time;

/**
 * 时间观察类
 * 
 * @author 林斌([email protected])
 * 
 */
public class Timewatch
{
    private long t0 = System.currentTimeMillis();
    private long t1 = System.currentTimeMillis();
    
    /**
     * 开始计时
     */
    public void start()
    {
        t0 = System.currentTimeMillis();
    }
    
    /**
     * 结束计时
     */
    public void end()
    {
        t1 = System.currentTimeMillis();
    }
    
    /**
     * 返回统计时间
     * 
     * @return
     */
    public long getTotal()
    {
        return t1 - t0;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy