Hi Pragya,

xdmp:elapsed-time() returns an xs:dateTimeDuration, which can be added directly 
to any xs:dateTime value:

fn:current-dateTime() + xdmp:elapsed-time()

Thanks.

-jb

From: 
<general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>>
 on behalf of Danny Sokolsky 
<danny.sokol...@marklogic.com<mailto:danny.sokol...@marklogic.com>>
Reply-To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Date: Sunday, May 1, 2016 at 6:02 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] start and end time xquery

Try xdmp:elapsed-time().
________________________________
From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 
[general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>]
 on behalf of Asit Nautiyal 
[asitnauti...@outlook.com<mailto:asitnauti...@outlook.com>]
Sent: Sunday, May 01, 2016 12:01 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] start and end time xquery


Hi Pragya,



Use xdmp:log() function at the start and end of your code execution.



________________________________
From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 
<general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>>
 on behalf of Kapoor, Pragya 
<pkapo...@innodata.com<mailto:pkapo...@innodata.com>>
Sent: Wednesday, April 27, 2016 9:00 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] start and end time xquery


Hi,


I need to find out the start and end time of the function executed in xquery.


For example when I click on the link find Collections( this is an xquery in 
which html is also embedded), this calls another xqy file on which the code for 
finding new collections is written.


Now, I need to find the start and end time for this function.

For this, I tried using fn:current-dateTime() at the start and end of this 
function and saving these values in an xml which is in turn stored in db.


But since it is a single transaction, both start and end time is same.


I think, for finding endTime we can use xdmp:elapsed-time and add that to  
fn:current-dateTime(). but how to add time to dateTime, to get again the 
dateTime format?


Some other approach is also welcomed.


Thanks

Pragya


"This e-mail and any attachments transmitted with it are for the sole use of 
the intended recipient(s) and may contain confidential , proprietary or 
privileged information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. Any 
unauthorized review, use, disclosure, dissemination, forwarding, printing or 
copying of this e-mail or any action taken in reliance on this e-mail is 
strictly prohibited and may be unlawful."
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to