Measurement time of a peace of code


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Measurement time of a peace of code

    Yes exactly, in this case it's just a matter of multiplying the value you get with 0.5 to get the answer in uS.

    If you want to do that in PBP then perhaps:
    Code:
    ' In us
    LCDOUT $FE, 1, ["Timer ticks: ", DEC Time]
    LCDOUT $FE, $C0, ["Execution time: ", DEC Time/2, "." DEC Time//2, "us",13]
    I think that should do it.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: Measurement time of a peace of code

    DT has a nice example here: http://www.picbasic.co.uk/forum/show...=1272#post1272

    Something else to consider is where the code you're timing is located. See the 1st paragraph.
    Last edited by Bruce; - 17th August 2011 at 19:50.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Measurement time of a peace of code

    I got it. Thank you all, once again!
    Thanks and Regards;
    Gadelhas

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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