Find the answer to your Linux question:
Results 1 to 3 of 3
Old guy, learned Fortran in 1964 when IBM 1620 had a spectacular 16K memory, some assembly, C (forgotten but will review), and VB . My application is to time successive ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2013
    Location
    Milwaukee
    Posts
    0

    Use of linus to measure time intervals less than milliseconds


    Old guy, learned Fortran in 1964 when IBM 1620 had a spectacular 16K memory, some assembly, C (forgotten but will review), and VB. My application is to time successive events hopefully to 0.01 ms. I am currently using an AD converter, and it is just too slow and clunky. I am awaiting a Raspberry Pi as a replacement.

    What is the minimum accuracy in time measurement? I want to measure the time between consecutive events, 1 to 2, 2 to 3, etc. Not worried about programming just yet, but what is the capability of linux for this app. Thanks. DB

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    hello and welcome, DB!

    check out the usleep function. On some systems (e.g. Fedora/RHEL that I know of), there is also a binary of the same name, which you can call in user space.
    Last edited by atreyu; 05-20-2013 at 04:02 AM. Reason: typo

  3. #3
    Just Joined!
    Join Date
    May 2013
    Location
    Milwaukee
    Posts
    0

    Timing function

    Quote Originally Posted by atreyu View Post
    hello and welcome, DB!

    check out the usleep function
    Thanks atreyu. That seems to be a valuable link particularly will all the related functions. When I wrote in assembly language I used a loop of a fixed number of clock cycles, counting the number of times through the "time wasting" loop, testing if the next event had occurred each time through. This was highly accurate compared to the system clock.

    I will look into that usleep function and the related ones as well. Good start.

    DB

Posting Permissions

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