Created
July 28, 2014 21:28
-
-
Save sayedihashimi/c1cf2bfafaec597793e4 to your computer and use it in GitHub Desktop.
msbuild get elapsed time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- | |
This shows how you can calculate the elapsed time in MSBuild | |
--> | |
<Target Name="BeforeBuild"> | |
<PropertyGroup> | |
<startTime>$([System.DateTime]::Now)</startTime> | |
</PropertyGroup> | |
</Target> | |
<Target Name="AfterBuild"> | |
<PropertyGroup> | |
<elapsed>$([System.DateTime]::Now.Subtract($(startTime)))</elapsed> | |
</PropertyGroup> | |
<Message Text="elapsed: $(elapsed)" Importance="high"/> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment