Home Forums Software Development C++ Interaction Library – What’s IL::Timestamp counted in?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20015
    Harrison
    Participant

    Hello,

    As the title says, I want to know what IL::Timestamp is counting in?
    I believe it’s based in microseconds (us) which is 1 second = 1000000 us

    Using some modified sample code:

    
    intlib->SubscribeGazeFocusEvents([](IL::GazeFocusEvent evt, void* context)
    {
        std::list<GazeEvent>& gazeVec = *static_cast<std::list<GazeEvent>*>(context);
    
        GazeEvent gaze = GazeEvent(evt.id, evt.timestamp_us, evt.hasFocus);
    
        gazeVec.push_back(gaze);
    
    }, &gazeVec);
    

    Printing out evt.timestamp_us I have this value: 25769125018
    Dividing that by 1000000 only gets: 25769.1
    And I definitely wasn’t running the code for 25769.1 seconds before the time was registered.

    So going back to my original question, what actually is IL::Timestamp?

    #20024
    Grant [Tobii]
    Keymaster

    Hi @itsmehjb, The IL::Timestamp is merely a number for an instant in time. It’s based from the processor clock and is counted in micro-seconds.

    It’s mainly to be used for relative purposes, eg this timestamp minus the last one. If required wants, one can simply save the first timestamp receivee and subtract that from all future timestamps to get “time since started”.

    One could also query the high-performance counter directly at the start of the program and use that as the zeroing-value, as long as it is converted to microseconds.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.