Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-25-2004, 08:02 AM
Shuang Shuang is online now
Registered User
 
Join Date: 09-04-2003
Posts: 6
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.
Reply With Quote
  #2  
Old 03-26-2004, 01:05 AM
rajivraj rajivraj is online now
Registered User
 
Join Date: 03-22-2004
Posts: 5
Send a message via Yahoo to rajivraj
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
Reply With Quote
  #3  
Old 03-26-2004, 06:46 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
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.
Reply With Quote
  #4  
Old 07-17-2009, 09:45 AM
digit digit is online now
Registered User
 
Join Date: 05-14-2009
Posts: 14
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);
Reply With Quote
  #5  
Old 09-12-2016, 12:47 PM
mevans mevans is offline
Registered User
 
Join Date: 04-21-2015
Posts: 32
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.
Reply With Quote
  #6  
Old 09-12-2016, 05:07 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
That's still the best way.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 04:07 AM.


Copyright © 1999-2023 Kinook Software, Inc.