Code example for Vector

Methods: firstElement, lastElement

0
    /** 
     * Compute the elapsed time (in milliseconds) between the first and last 
     * event on the logger's trace. 
     */ 
    public long getElapsedTime() { 
        long startTime = ((Event) trace.firstElement()).getTimeStamp();
        long endTime = ((Event) trace.lastElement()).getTimeStamp();
        return endTime - startTime;
    } 
 
}