Apache Velocity (VTL) 性能分析
我需要弄清楚某些代码在 Velocity (VTL) 中花费了多长时间。像这样的事情:
#set(start = getTickCount())
... do some stuff that takes a while ...
#set(end = getTickCount())
#set(time = end - start)
It took $time milliseconds!
Velocity 有 getTickCount() 函数或类似的函数吗?或者还有其他推荐的方法来进行分析吗?
I need to figure out how long some code is taking in Velocity (VTL). Something like this:
#set(start = getTickCount())
... do some stuff that takes a while ...
#set(end = getTickCount())
#set(time = end - start)
It took $time milliseconds!
Does Velocity have a getTickCount() function or some equivalent? Or is there some other recommended way to do profiling?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的库存 VelocityTools 之一是日志分析器,但如果您想按照您的指示更手动地执行此操作,您可以在其中粘贴一个为您提供
currentTimeMillis
的工具,或者添加系统
类直接按照静态类文档 。One of my stock VelocityTools is a logging profiler, but if you want to do it more manually as you indicate, you could just stick a tool in there that gives you the
currentTimeMillis
, or add theSystem
class directly as per the static classes docs.