Duration spent on a webpage using chrome.history

I am developing a chrome extension which tracks time spent on a particular webpage.for that i was using chrome.history api.But it only returns the time of visit not the duration spent on a perticular webpage.

chrome.history.search({text:"www.wwe.com"},function(historyItems){
            console.log(parseInt(historyItems[0].lastVisitTime));
        });

so, how can i get the duration spent on a webpage.