2011-10-12 70 views
0

我需要弄清楚某些代碼在Velocity(VTL)中所花的時間。這樣的事情:Apache Velocity(VTL)性能分析

#set(start = getTickCount()) 

... do some stuff that takes a while ... 

#set(end = getTickCount()) 

#set(time = end - start) 

It took $time milliseconds! 

速度有一個getTickCount()函數或一些等效?或者還有其他一些建議的分析方法嗎?

回答

1

我的一個股票VelocityTools是一個日誌分析器,但如果你想要更多的手動爲你指示做,你可以只堅持一個工具,在那裏,讓你的currentTimeMillis,或者直接添加System類爲每static classes docs