Skip to content

Instantly share code, notes, and snippets.

@mattjohnsonpint
Forked from sayedihashimi/elapsed-time.proj
Created July 28, 2014 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattjohnsonpint/10af027aaaab2d8b95ae to your computer and use it in GitHub Desktop.
Save mattjohnsonpint/10af027aaaab2d8b95ae to your computer and use it in GitHub Desktop.
<?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]::UtcNow)</startTime>
</PropertyGroup>
</Target>
<Target Name="AfterBuild">
<PropertyGroup>
<elapsed>$([System.DateTime]::UtcNow.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