Skip to content

Instantly share code, notes, and snippets.

@mwjackson
Created January 5, 2012 17:43
Show Gist options
  • Save mwjackson/1566309 to your computer and use it in GitHub Desktop.
Save mwjackson/1566309 to your computer and use it in GitHub Desktop.
run iterations of msbuild and record avg time
#!/usr/bin/env python
from datetime import datetime
import subprocess
starttime = datetime.now()
print "start time:", starttime
numIterations = 1
for i in xrange(0,numIterations):
print "build num:", i
subprocess.check_call([r"C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe", r"C:\Users\matt.jackson\projects\v3\BuildAllSolutions.msbuild", "/t:CleanBuildDir;BuildCommonIntegrationMessages,BuildPayments"])
print "build finished:", datetime.now()
endtime = datetime.now()
print "start time:", starttime
print "endtime:", endtime
print "duration:", endtime - starttime
print "avg:", (endtime - starttime) / numIterations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment