我需要弄清楚一些代码在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()函数或类似的函数?还有没有其他推荐的分析方法?
发布于 2011-10-18 08:36:09
我的一个常用VelocityTools是一个日志分析器,但是如果您想要像您所说的那样更加手动地完成,那么您可以直接在其中插入一个工具来为您提供currentTimeMillis,或者根据static classes docs直接添加System类。
https://stackoverflow.com/questions/7744896
复制相似问题