Click here to Skip to main content
13,287,232 members (48,339 online)
Click here to Skip to main content
Add your own
alternative version


9 bookmarked
Posted 1 Oct 2001

Build Duration Macro

, 1 Oct 2001
Rate this:
Please Sign up or sign in to vote.
A DevStudio macro that displays the project's build duration
<!-- Main HTML starts here -->


This macro adds a missing feature to DevStudio6. It displays project build duration. You'll see a new tab named Macro in the output window (next to the standard tabs: Build, Debug, Find in files...)

Open your macro file and insert the following line before any other functions or subroutines.

Public dBuildStartTime

Next, place the code below somewhere in your macro file. These events (Application_BeforeBuildStart and Application_BuildFinish) will be automatically triggered by DevStudio when you build your projects.

Sub Application_BeforeBuildStart()
	' keep the build-starting time
	dBuildStartTime = Now
	Application.PrintToOutputWindow " "
	Application.PrintToOutputWindow "--------------------------------"
	Application.PrintToOutputWindow "Build start: " & dBuildStartTime
End Sub

Sub Application_BuildFinish(nNumErrors, nNumWarnings)
	' get build time
	dNow = Now

	sec = DateDiff("s", dBuildStartTime, dNow)

	hours = sec \ 3600
	sec = sec - hours * 3600

	min = sec \ 60
	sec = sec - min * 60

	' format
	Dim strH, strM, strS

	If hours > 10 Then
		strH = hours
		strH = "0" & hours
	End If

	If min > 10 Then
		strM = min
		strM = "0" & min
	End If

	If sec > 10 Then
		strS = sec
		strS = "0" & sec
	End If

	' display
	Application.PrintToOutputWindow "Build end:   " & dNow
	Application.PrintToOutputWindow "Build time:  " & strH & ":" & strM & ":" & strS
	Application.PrintToOutputWindow nNumWarnings & " warning(s), " & nNumErrors & " error(s)."

End Sub


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralDevStudio6 has this option Pin
Francisco José Sen2-Oct-01 3:53
memberFrancisco José Sen2-Oct-01 3:53 
GeneralRe: DevStudio6 has this option Pin
Miezoo3-Oct-01 0:14
memberMiezoo3-Oct-01 0:14 
GeneralRe: DevStudio6 has this option Pin
Philippe Lhoste9-Oct-01 2:24
memberPhilippe Lhoste9-Oct-01 2:24 
GeneralRe: DevStudio6 has this option Pin
Jack Hendriks8-Oct-01 21:03
memberJack Hendriks8-Oct-01 21:03 
GeneralRe: DevStudio6 has this option Pin
Francisco José Sen8-Oct-01 22:31
memberFrancisco José Sen8-Oct-01 22:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 2 Oct 2001
Article Copyright 2001 by Miezoo
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid