Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-09-2012, 02:16 AM
maorlast2 maorlast2 is online now
Registered User
 
Join Date: 01-09-2011
Posts: 6
How to calculate build time

I created these build time events

Application.Macros(vbldTemporary).Add "START_TIME", vbld_FormatTime()
Application.Macros(vbldTemporary).Add "START_TIME_EX", vbld_FormatDateEx(now,"hh:MM:SS")

Application.Macros(vbldTemporary).Add "END_TIME", vbld_FormatTime()
Application.Macros(vbldTemporary).Add "END_TIME_EX", vbld_FormatDateEx(now,"hh:MM:SS")

(_EX means that this is expression that i print in the log)
How can i calculate the build time?
Reply With Quote
  #2  
Old 01-09-2012, 09:07 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
There is a property on the build object with the build start time:
http://www.kinook.com/VisBuildPro/Ma...meproperty.htm

And to calculate:
Code:
sec = DateDiff("s", Builder.StartTime, Now)
hr = Int(sec / 3600)
sec = sec - hr * 3600
min = Int(sec / 60)
sec = Int(sec Mod 60)

' format in hh:mm:ss format	
strElapsed = vbld_PadLeft(CStr(hr), 2, "0") & ":" & _
	vbld_PadLeft(CStr(min), 2, "0") & ":" & vbld_PadLeft(CStr(sec), 2, "0")
http://www.w3schools.com/vbscript/func_datediff.asp
Reply With Quote
  #3  
Old 01-09-2012, 10:20 AM
maorlast2 maorlast2 is online now
Registered User
 
Join Date: 01-09-2011
Posts: 6
reply

if i will follow your approach, how can substring 'Builder.StartTime' and 'Now' to take only the time without the date

i.e:
1/9/2012 17:16:36 --> 17:16:36

(i want to save the start and end time in a variable)

Thanks
Reply With Quote
  #4  
Old 01-09-2012, 11:02 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
http://www.w3schools.com/vbscript/func_timevalue.asp
Reply With Quote
Reply


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 10:06 AM.


Copyright © 1999-2023 Kinook Software, Inc.