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. CLOCKS_PER_SEC

CLOCKS_PER_SEC

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • J Offline
    J Offline
    Janette
    wrote on last edited by
    #1

    Hi, How can I find out the value of CLOCKS_PER_SEC? Best regards/ Janette :rose:

    C _ H 3 Replies Last reply
    0
    • J Janette

      Hi, How can I find out the value of CLOCKS_PER_SEC? Best regards/ Janette :rose:

      C Offline
      C Offline
      CoY0te
      wrote on last edited by
      #2

      It's defined in Time.h and it's value is 1000. By the way - using windows timer is sometimes not enough. Although CLOCKS_PER_SEC is 1000, the timer is updated approximately every 55ms, that is less than 20 times per second. As for me i prefer to use QueryPerformanceCounter and QueryPerformanceFrequency functions - these use a timer that is updated very often (depends on hardware). I should be "smoother" than 1us (over 1MHz frequency). Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.

      1 Reply Last reply
      0
      • J Janette

        Hi, How can I find out the value of CLOCKS_PER_SEC? Best regards/ Janette :rose:

        _ Offline
        _ Offline
        _Magnus_
        wrote on last edited by
        #3

        Enable browse info and press F12 "Search in files" for it. Print it out. Get Visual Assist and hover to mouse over it. /Magnus


        - I don't necessarily agree with everything I say

        1 Reply Last reply
        0
        • J Janette

          Hi, How can I find out the value of CLOCKS_PER_SEC? Best regards/ Janette :rose:

          H Offline
          H Offline
          Haakon S
          wrote on last edited by
          #4

          Anywhere in your code (e.g. in your CMainFrame constructor)put in UINT test=CLOCKS_PER_SEC; Set a breakpoint and run it in debug mode. ;) Regards, Hakon.

          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