获取使用ANT时间戳差值 [英] Get timestamp difference using ANT

查看:429
本文介绍了获取使用ANT时间戳差值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Ant来计算时间差。结果
基本上,它有2个变量。一个被分配的当前时间,而另一个具有不同的时间。我需要使用Ant的时间差。类似下面。如果任何人有code请回复。

I need to calculate time difference using Ant.
Basically it has 2 variables. One is assigned the current time, and the other one has a different time. I need to get the time difference using Ant. Something like below. If anyone have code please reply.

variable a = current time;
variable b = different time
echo (a - b) ;

谢谢,

巴吞

推荐答案

下面是一个更简单的解决方案:

Here is a much simpler solution:

<script language="javascript">
  project.setProperty('startTime', new Date().getTime());
</script>
...
<script language="javascript">
  project.setProperty('elapsedTime', new Date().getTime() - startTime)
</script>
<echo>Elapsed time: ${elapsedTime} ms</echo>

这篇关于获取使用ANT时间戳差值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆