Kinook Software Forums

Kinook Software Forums (http://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (http://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Calculate duration based on %DATETIME% (http://www.kinook.com/Forum/showthread.php?t=377)

Shuang 03-25-2004 09:02 AM

Calculate duration based on %DATETIME%
 
I want to benchmark the performance of an application. What would be the best way to calculate a duration based on %DATETIME% at the beginning and ending. Can it be done without VS or J scripting?

Thanks.

rajivraj 03-26-2004 02:05 AM

Am not sure if this is the best way, but :

1. Insert a "Set Macro" action as the first step and set the value of the macro value as %DATETIME%

2. Insert a "Run Script" action as the last step. Here you can use the marco of the first step and the %DATETIME% to compare the time difference.

Hope that helps.

Cheers!
Rajiv. R
Rajspace.Org

kinook 03-26-2004 07:46 AM

Scripting would be necessary. The following in a Log Message step at the end of the build would give the build time in seconds (VBScript must be the default script language in Tools | Application Options | General):

Build elapsed time = [DateDiff("s", Builder.StartTime, Now)] seconds

Or in a Run Script step (if VBScript is not the default language):

Builder.LogMessage "Build elapsed time = " & DateDiff("s", Builder.StartTime, Now) & " seconds"

Or to get a different time interval, get the start time as mentioned in the previous post and replace Builder.StartTime with CDate("%START_TIME%") replacing START_TIME with whatever macro name you used.

digit 07-17-2009 10:45 AM

Since I love JScript (and hate VBScript), doing an elapsed time calculation in JScript is...
Code:

var seconds = Math.floor((new Date() - new Date(Builder.StartTime)) / 1000);

mevans 09-12-2016 01:47 PM

I was also looking for the elapsed time. I see how to do it from the post. As this post was a few years ago, is that still the best way to get the elapsed time, or are there any built-in macros or functions that return it?

It's no big deal if this is still the best way to do it; I'm just checking as Visual Build has had enhancements since this information.

kinook 09-12-2016 06:07 PM

That's still the best way.


All times are GMT -5. The time now is 09:58 PM.


Copyright 1999-2019 Kinook Software, Inc.