Apache Velocity (VTL) 性能分析

发布于 2024-12-09 06:20:06 字数 296 浏览 4 评论 0原文

我需要弄清楚某些代码在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟酒忠诚 2024-12-16 06:20:06

我的库存 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 the System class directly as per the static classes docs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文