Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   How to calculate build time (https://www.kinook.com/Forum/showthread.php?t=4949)

maorlast2 01-09-2012 01:16 AM

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?

kinook 01-09-2012 08:07 AM

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

maorlast2 01-09-2012 09:20 AM

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

kinook 01-09-2012 10:02 AM

http://www.w3schools.com/vbscript/func_timevalue.asp


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


Copyright © 1999-2023 Kinook Software, Inc.