After some search, I used to managed this using a formula that looks like this :
result.Duration=Calc();
function Calc(){
var n,nt,d,tt;
n = new Date();
var hou = n.getHours() * 3600
var min = n.getMinutes() * 60;
var sec = n.getSeconds();
// Nb secondes ecoulees ce jour
var nt = hou + min + sec;
// Temps de Login en secondes
tt = ccpulse.AGENTS.TpsDeLogin;
d = nt - tt;
return d;
where “ccpulse.AGENTS.TpsDeLogin” is :
[CurrTime_LoggedIn]
Category=CurrentTime
Description=
Formula=
MainMask=LoggedIn
Objects=Agent, GroupAgents, GroupPlaces, Place
Subject=DNAction