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 / C++ / MFC
  4. How to measure number of cycles of a C code

How to measure number of cycles of a C code

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomalgorithmssecuritytutorial
4 Posts 4 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.
  • T Offline
    T Offline
    Tiza Naziri
    wrote on last edited by
    #1

    Hi, I have written a C code of an encryption algorithm. How do I measure the number of cycles of my implementation? Hope to get some feedbacks/suggestion from the forum members, or can email the feedbacks to my email address watija@yahoo.com. Regards, Tiza Naziri, Malaysia

    T W C 3 Replies Last reply
    0
    • T Tiza Naziri

      Hi, I have written a C code of an encryption algorithm. How do I measure the number of cycles of my implementation? Hope to get some feedbacks/suggestion from the forum members, or can email the feedbacks to my email address watija@yahoo.com. Regards, Tiza Naziri, Malaysia

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      just put a Counter(an unsigned int or long or anthing like that) in your Cycling Function( :-D ) i.e. encryption algorithm. and every time the Encryption Algorithm make a cycle, increment the Counter by one, and when your cycling function end, you will get number of cycles in the Counter


      "I Think this Will Help"

      visit me at http://www.thisisalok.tk
      1 Reply Last reply
      0
      • T Tiza Naziri

        Hi, I have written a C code of an encryption algorithm. How do I measure the number of cycles of my implementation? Hope to get some feedbacks/suggestion from the forum members, or can email the feedbacks to my email address watija@yahoo.com. Regards, Tiza Naziri, Malaysia

        W Offline
        W Offline
        wb
        wrote on last edited by
        #3

        if you want to count the CPU cycles, you must set up a highperformance timer. check out the articles on timers here on CP. http://www.codeproject.com/datetime/ccputicker.asp[^]

        1 Reply Last reply
        0
        • T Tiza Naziri

          Hi, I have written a C code of an encryption algorithm. How do I measure the number of cycles of my implementation? Hope to get some feedbacks/suggestion from the forum members, or can email the feedbacks to my email address watija@yahoo.com. Regards, Tiza Naziri, Malaysia

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          if you want to know CPU cycles (ex. "it takes X cycles to do one round"), you'll have to analyze a machine-language implementation of your algorithm. Image Toolkits | Image Processing | Cleek

          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