我有一個XSLT(在Sitecore下運行),我想要進行基準測試。如何讓我的XSLT執行時間達到毫秒級精度?
例如:
<xsl:variable name="start_ms" select="TIME IN MILLIS" />
Do something
<xsl:variable name="end_ms" select="TIME IN MILLIS" />
<xsl:variable name="total_ms" select="$end_ms - $start_ms" />
Do something else
可惜我不能設法得到毫秒級精確度的時間。
如果我包括xmlns:date="http://exslt.org/dates-and-times"
我得到date:dateTime()
,但只有秒精度。
同樣,sc:formatdate(sc:isoNow(),'ss.ffff')
也只能達到秒精度。
Sitecore「調試頁面」功能會告訴我運行整個XSLT需要多長時間,但它不會讓我對XSLT的各個組件進行基準測試。
有沒有辦法做到這一點?