briantdavis / EAS_BBB_DataAcquisition

EAS data acquisition using BeagleBone Black
GNU General Public License v2.0
6 stars 10 forks source link

Improve Timestamp #1

Open briantdavis opened 8 years ago

briantdavis commented 8 years ago

The current Timestamp is very coarse timing - using the clock_t structure & clock() function. Improve the timestamp - sample code from NCAR capstone project.

ghost commented 8 years ago

I didn't see any obvious time reference in the code, so I made a pull with a small file that gets realtime in nanoseconds.

(See Pull Request)

I cannot tell if it will be any faster than the "clock_t structure & clock() function", but I'm hopeful none the less.

My device reads about 3 microSeconds per loop. (doing nothing else)

[See code to make sense of the following: There is also a "Monotonic" variable that can be used instead of the "Realtime" value, but I do not yet know exactly what it does]

ghost commented 8 years ago

As we discussed, we will want to look into the specifics of the "CLOCK_REALTIME" and "CLOCK_MONOTIME" System variable to assess which is more practical for our application.

I wrote a very dirty test script to gather the maximum, minimum, and averages for both calls. What I see is that they're largely the same having a maximum value of 1 second to a minimum of -1 second. I'm not sure if that is simply the nature of the clock or if that is an error on my part, we can look at it in greater detail at the next meeting.

briantdavis commented 8 years ago

A dual timestamp is implemented in commit #53.

The output in daqPack >> operator is still not human readable.

Hopefully a single timestamp option will prove functional & reduce computation / jitter.