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. Managed C++/CLI
  4. nanosecond

nanosecond

Scheduled Pinned Locked Moved Managed C++/CLI
question
5 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.
  • M Offline
    M Offline
    mehmetned
    wrote on last edited by
    #1

    how do i get the system time as nanosecond?

    M 1 Reply Last reply
    0
    • M mehmetned

      how do i get the system time as nanosecond?

      M Offline
      M Offline
      mehmetned
      wrote on last edited by
      #2

      I want to make a one second while loop but the resolution of the time must be very high (nanosecond). Thanks

      B J 2 Replies Last reply
      0
      • M mehmetned

        I want to make a one second while loop but the resolution of the time must be very high (nanosecond). Thanks

        B Offline
        B Offline
        Bob X
        wrote on last edited by
        #3

        I'm not sure how you get the time in nanoseconds of the top of my head, but you might be able to do what you want to do with a timer function.

        J 1 Reply Last reply
        0
        • B Bob X

          I'm not sure how you get the time in nanoseconds of the top of my head, but you might be able to do what you want to do with a timer function.

          J Offline
          J Offline
          Jonathan Darka
          wrote on last edited by
          #4

          Bob X wrote:

          you might be able to do what you want to do with a timer function

          no chance (if you mean windows WM_TIMER) as it is not high enough resolution, QueryPerformanceCounter() is better but I don't think you will ever get a one nanosecond loop as WIndows is not a realtime operating system. See here: http://msdn.microsoft.com/msdnmag/issues/04/03/HighResolutionTimer/[^] Why do you need such accuracy anyway?

          1 Reply Last reply
          0
          • M mehmetned

            I want to make a one second while loop but the resolution of the time must be very high (nanosecond). Thanks

            J Offline
            J Offline
            Jeremy Thornton
            wrote on last edited by
            #5

            :confused:I am most intrigued by an application that requires an event to occur every second but to 1 billionth of a second accuracy, please tell us more... If you need +/- 1ns accuracy then because the windows OS family are not real time operating systems this will not be acheivable, perhaps +/- 10ns but realistically +/- 100ns should be assumed. If this is not adequate, then in order to measure to 1ns with an acceptable error then you actually need sub nanosecond timing solutions. Have you calculated what level of error you can tolerate in the application to which this problem pertains?

            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