Difference between revisions of "OpenIGTLink/Timestamp"

From NAMIC Wiki
Jump to: navigation, search
Line 13: Line 13:
  
 
== Obtaining timestamp ==
 
== Obtaining timestamp ==
* '''itk::RealTimeClock'''
+
* [http://www.itk.org/Doxygen34/html/classitk_1_1RealTimeClock.html itk::RealTimeClock]
 
* '''Linux''' / '''Mac''': [http://www.hmug.org/man/3/ftime.php ftime()]
 
* '''Linux''' / '''Mac''': [http://www.hmug.org/man/3/ftime.php ftime()]
 
* '''Windows''': [http://msdn2.microsoft.com/en-us/library/z54t9z5f(VS.71).aspx ftime()] - 10 ms resolution
 
* '''Windows''': [http://msdn2.microsoft.com/en-us/library/z54t9z5f(VS.71).aspx ftime()] - 10 ms resolution

Revision as of 19:38, 10 January 2008

Home < OpenIGTLink < Timestamp

<< OpenIGTLink << Protocol


Big Endian format: bits numbered in big-endian fashion from 0 starting at the left, or high-order, position.

Seconds and fraction of seconds: timestamps are represented as a 64-bit unsigned fixed-point number, in seconds relative to 00:00:00 January 1, 1970, UTC. The integer part is in the first 32 bits (Unix-style timestamp) and the fraction part in the last 32 bits. In the fraction part, the non-significant low order can be set to 0.

Wrap around: The first 32-bit field will overflow some time in 2106 (second 4,294,967,296)

Obtaining timestamp

Time synchronization

Two solutions:

  1. Install NTP on all devices
  2. Compute timestamp differences (local NTP can be used)

Resources