This works. Thanks for the help.

 
Ningjun Wang, Ph.D.
Consulting Software Engineer
 
LexisNexis Global Solutions Dev
New Providence, NJ
(908) 665-6787
-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Kelly Stirman
Sent: Wednesday, June 22, 2011 3:05 PM
To: [email protected]
Subject: Re: [MarkLogic Dev General] How to measure the time duration of some 
function call

You can use xdmp:elapsed-time().

Message: 2
Date: Wed, 22 Jun 2011 18:23:07 +0000
From: "Wang, Ningjun (LNG-NPV)" <[email protected]>
Subject: [MarkLogic Dev General] How to measure the time duration of
        some    function call
To: General MarkLogic Developer Discussion
        <[email protected]>
Message-ID:
        <1533716386a4d547ad15701487022d4822b37...@retdaymbxp004.legal.regn.net>
        
Content-Type: text/plain; charset="us-ascii"

I am new to xquery and MarkLogic. I need to measure the time duration of 
certain heavy duty xquery function call. Here is the sample code

let $t1 := current-dateTime()
let $r := some_long_running_function()
let $t2 := current-dateTime()
return ($t1, $t2, $t2 - $t1)

I found that $t1 and $t2 are always the same no matter how long the function 
run. Here is an example result

  <v:results v:warning="more than one node" 
xmlns:v="com.marklogic.developer.cq.view">2011-06-22T14:17:55.35-04:00 
2011-06-22T14:17:55.35-04:00 PT0S</v:results>

What did I do run? How can I measure the time duration of the function 
some_long_running_function()?

Thanks


Ningjun Wang
Consulting Software Engineer

LexisNexis Global Solutions Dev
New Providence, NJ
(908) 665-6787
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to