/*
 * @class  Cav's Core Lib
 * @author Mike Cavaliere
 * 
 *
 */
if (typeof Cav === 'undefined')
{
    
}
var Cav = {};

Cav.log = function(str)
{
    if (typeof str === 'undefined') { return; }

    var output = document.getElementById('output');
    
    for (var key in str)
    {
        output.innerHTML += str[key].name + ':' + str[key].delta + "ms<br />";    
    }
};


$(function()
{
    time.setReportMethod(Cav.log);
    
    var main = $('#main');
    
    // Appending
    time.start('Appending');
    
    
    for (var i=0; i<500; i++)
    {
        main.append('<h3>This is an appended element.</h3>');
    }
    
    time.stop('Appending');
    
    // Traversal
    time.start('Selector');
    
    var results = $('h3:nth-child(300)');
    
    time.stop('Selector');
    
    time.start('Offset Calculation');
    
    $('h3').each(function()
    {
       var offset = $(this).offset();
    });
    
    time.stop('Offset Calculation');
    
    time.start('Position Calculation');
    
    $('h3').each(function()
    {
       var position = $(this).position();
    });
    
    time.stop('Position Calculation');
    
    
    
    
    
    time.report();
    
    
    
    //Cav.log();
    
});