Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Timing Code Execution

Timing Code Execution

Scheduled Pinned Locked Moved C#
toolsquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Donald_a
    wrote on last edited by
    #1

    I need to time how long certain methods are taking to run to a very fine level. Too fine for using DateTime and TimeSpan. Does anyone know of any tools that i can use to analyse which methods are bottlenecks? Thanks

    L J J D 4 Replies Last reply
    0
    • D Donald_a

      I need to time how long certain methods are taking to run to a very fine level. Too fine for using DateTime and TimeSpan. Does anyone know of any tools that i can use to analyse which methods are bottlenecks? Thanks

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      Try a profiler like ANTS. Or use interop to query the performance counter. leppie::AllocCPArticle("Zee blog");
      Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.

      1 Reply Last reply
      0
      • D Donald_a

        I need to time how long certain methods are taking to run to a very fine level. Too fine for using DateTime and TimeSpan. Does anyone know of any tools that i can use to analyse which methods are bottlenecks? Thanks

        J Offline
        J Offline
        Joe Woodbury
        wrote on last edited by
        #3

        I'm working on the same thing right now. System.Diagnostics provides access to the performance counters. That's all I can since I just looked at ten seconds ago. When all else fails, there's always delusion. - Conan O'Brien

        1 Reply Last reply
        0
        • D Donald_a

          I need to time how long certain methods are taking to run to a very fine level. Too fine for using DateTime and TimeSpan. Does anyone know of any tools that i can use to analyse which methods are bottlenecks? Thanks

          J Offline
          J Offline
          Jeremy Kimball
          wrote on last edited by
          #4

          It's exceedingly primitive, but combinations of System.Debug.Trace.WriteLines in conjunction with calls to System.Environment.TickCount have always served me well...just grab the tickcount into a long variable at the beginning of a method, and difference it with the current tickcount at the end of the method, then dump the output to the trace. Jeremy Kimball

          1 Reply Last reply
          0
          • D Donald_a

            I need to time how long certain methods are taking to run to a very fine level. Too fine for using DateTime and TimeSpan. Does anyone know of any tools that i can use to analyse which methods are bottlenecks? Thanks

            D Offline
            D Offline
            Donald_a
            wrote on last edited by
            #5

            Thanks for the replies guys. I actually found a very useful article here on CodeProject which may be of interest? Can be found at: http://www.codeproject.com/useritems/highperformancetimercshar.asp?target=timing Thanks again.

            U 1 Reply Last reply
            0
            • D Donald_a

              Thanks for the replies guys. I actually found a very useful article here on CodeProject which may be of interest? Can be found at: http://www.codeproject.com/useritems/highperformancetimercshar.asp?target=timing Thanks again.

              U Offline
              U Offline
              Uwe Keim
              wrote on last edited by
              #6

              Use the FREE .NET Profiler from www.numega.com [^] -- - Free Windows-based CMS: www.zeta-software.de/enu/producer/freeware/download.html - See me: www.magerquark.de

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups