Click here to Skip to main content
15,885,216 members
Articles / Programming Languages / C#

Simple Time-profiling in .NET

Rate me:
Please Sign up or sign in to vote.
3.80/5 (4 votes)
8 Jun 2007CPOL2 min read 49.2K   439   24  
With this small library, it's simple to add calls to time-profile your .NET application
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.20404</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{E73BB233-D88B-44A7-A98F-D71EE158381D}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Aga.Controls</RootNamespace>
    <AssemblyName>Aga.Controls</AssemblyName>
    <SccProjectName>
    </SccProjectName>
    <SccLocalPath>
    </SccLocalPath>
    <SccAuxPath>
    </SccAuxPath>
    <SccProvider>
    </SccProvider>
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>2.0</OldToolsVersion>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>TRACE;DEBUG</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <CodeAnalysisRules>-Microsoft.Design#CA1020;-Microsoft.Design#CA1060;-Microsoft.Design#CA1062;-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302;-Microsoft.Globalization#CA1303;-Microsoft.Globalization#CA1306;-Microsoft.Globalization#CA1304;-Microsoft.Globalization#CA1305;-Microsoft.Globalization#CA1300;-Microsoft.Maintainability#CA1501;-Microsoft.Mobility#CA1601;-Microsoft.Performance#CA1805;-Microsoft.Performance#CA1815;-Microsoft.Performance#CA1819;-Microsoft.Usage#CA2208</CodeAnalysisRules>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Design" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="GifDecoder.cs" />
    <Compile Include="ResourceHelper.cs" />
    <Compile Include="StringCollectionEditor.cs" />
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="BitmapHelper.cs" />
    <Compile Include="Threading\AbortableThreadPool.cs" />
    <Compile Include="Threading\WorkItemStatus.cs" />
    <Compile Include="Threading\WorkItem.cs" />
    <Compile Include="TimeCounter.cs" />
    <Compile Include="Tree\Input\ReorderColumnState.cs" />
    <Compile Include="Tree\NodeControls\ExpandingIcon.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\NodeControls\InteractiveControl.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\NodeControls\DrawEventArgs.cs" />
    <Compile Include="Tree\NodeControls\NodeEventArgs.cs" />
    <Compile Include="Tree\SortedTreeModel.cs" />
    <Compile Include="Tree\TreeModelBase.cs" />
    <Compile Include="Tree\AutoRowHeightLayout.cs" />
    <Compile Include="Tree\Input\ClickColumnState.cs" />
    <Compile Include="Tree\Input\ColumnState.cs" />
    <Compile Include="Tree\TreeViewAdv.Draw.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\TreeViewAdv.Input.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\IRowLayout.cs" />
    <Compile Include="Tree\FixedRowHeightLayout.cs" />
    <Compile Include="Tree\NodeControlInfo.cs" />
    <Compile Include="Tree\NodeControls\NodeControlValueEventArgs.cs" />
    <Compile Include="Tree\NodeControls\NodeNumericUpDown.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\IncrementalSearch.cs" />
    <Compile Include="TextHelper.cs" />
    <Compile Include="Tree\TreeViewAdv.Properties.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\TreeListAdapter.cs" />
    <Compile Include="Tree\TreeNodeAdvMouseEventArgs.cs" />
    <Compile Include="Tree\Node.cs" />
    <Compile Include="Tree\NodeControls\BaseTextControl.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\NodeControls\EditableControl.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\NodeControls\NodeComboBox.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\NodeControls\NodeControlsCollection.cs" />
    <Compile Include="Tree\Input\InputState.cs" />
    <Compile Include="Tree\IToolTipProvider.cs" />
    <Compile Include="Tree\Input\ResizeColumnState.cs" />
    <Compile Include="Tree\TreeColumn.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\TreeColumnCollection.cs" />
    <Compile Include="Tree\TreeColumnEventArgs.cs" />
    <Compile Include="Tree\TreeModel.cs" />
    <Compile Include="Tree\TreeViewAdvCancelEventArgs.cs" />
    <Compile Include="Tree\TreeViewAdvEventArgs.cs" />
    <Compile Include="Tree\TreePathEventArgs.cs" />
    <Compile Include="Tree\EditorContext.cs" />
    <Compile Include="Tree\Input\InputWithShift.cs" />
    <Compile Include="Tree\Enums.cs" />
    <Compile Include="Tree\Input\NormalInputState.cs" />
    <Compile Include="Tree\Input\InputWithControl.cs" />
    <Compile Include="Tree\NodeControls\NodeControl.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\DropPosition.cs" />
    <Compile Include="Tree\NodeControls\BindableControl.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\NodeControls\NodeCheckBox.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\NodeControls\NodeIcon.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\DrawContext.cs" />
    <Compile Include="Tree\ITreeModel.cs" />
    <Compile Include="Tree\NodeControls\NodePlusMinus.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\NodeControls\NodeTextBox.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Tree\NodeControls\NodeStateIcon.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\TreeModelEventArgs.cs" />
    <Compile Include="Tree\TreeNodeAdv.cs" />
    <Compile Include="Tree\TreePath.cs" />
    <Compile Include="Tree\TreeViewAdv.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="Tree\TreeViewAdv.Designer.cs">
      <DependentUpon>TreeViewAdv.cs</DependentUpon>
    </Compile>
    <Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
    <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
  </ItemGroup>
  <ItemGroup>
    <None Include="key.snk" />
    <None Include="Resources\minus.bmp" />
    <None Include="Resources\plus.bmp" />
    <None Include="Resources\check.bmp" />
    <None Include="Resources\uncheck.bmp" />
    <None Include="Resources\Leaf.bmp" />
    <None Include="Resources\Folder.bmp" />
    <None Include="Resources\FolderClosed.bmp" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Properties\Resources.resx">
      <SubType>Designer</SubType>
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="Resources\loading_icon" />
    <None Include="Tree\ClassDiagram.cd" />
    <None Include="Tree\NodeControls\ClassDiagram.cd" />
    <None Include="Resources\unknown.bmp" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Resources\DVSplit.cur" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions