dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: the time in each function

  1. #1
    Join Date
    Sep 2006
    Posts
    28

    the time in each function

    My project is about getting data from USB port for processing something.
    The data is very fast(around 1Mbyte/sec) and I'm not sure my program can process this job in time or not.
    I need to check the time in each function.

    How can I check it?

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,559

    Re: the time in each function

    Run the profiler.

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: the time in each function

    I'm not sure whether this is what you want, but have a look on this FAQ.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,116

    Re: the time in each function

    Quote Originally Posted by GCDEF
    Run the profiler.
    Be careful, profilers can significantly impact the timing of code. Look carefully at the documentation for your profiler.

    IMHO, for real-time (or even near-real-time), it is better to "Instrument" the tiime sensitive operations from the beginning)

    I tend to put "Prolog" and "Epilog" calls at the beginning and end of all of my methods (I have found it handy enough that my editor hotkey automatically does this).

    For RTS, the prolog simply inserts the information I wish to log into a queue, a low-priority thread [or in some cases a different process] pulls the information from the queue and logs it.

    My measured overhead [3.2Ghz P4] is just under 0.5uS, so I do remove it from the very tightest innermost loops.....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)