Click here to Skip to main content
Click here to Skip to main content
Go to top

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 -->

Introduction

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
	Else
		strH = "0" & hours
	End If

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

	If sec > 10 Then
		strS = sec
	Else
		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

License

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

Share

About the Author

Miezoo

United States United States
No Biography provided

Comments and Discussions

 
GeneralDevStudio6 has this option PinmemberFrancisco José Sen2-Oct-01 2:53 
GeneralRe: DevStudio6 has this option PinmemberMiezoo2-Oct-01 23:14 
GeneralRe: DevStudio6 has this option PinmemberPhilippe Lhoste9-Oct-01 1:24 
GeneralRe: DevStudio6 has this option PinmemberJack Hendriks8-Oct-01 20:03 
GeneralRe: DevStudio6 has this option PinmemberFrancisco José Sen8-Oct-01 21:31 

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

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

| Advertise | Privacy | Mobile
Web01 | 2.8.140921.1 | Last Updated 2 Oct 2001
Article Copyright 2001 by Miezoo
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid