Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 15:33:01 +0000



Post From: adding milliseconds to realtime clock to create a latency

[2018-06-12 19:36:57]
User61576 - Posts: 418
I took the "clock-realtime" study code and I am trying to add to it milliseconds.

I changed the function from GetTimeHMS to GetDateTimeYMDHMS_MS() according to the documentation here: Working with the SCDateTime Variables and Values: GetDateTimeYMDHMS_MS()

int Year= 0, Month= 0, Day= 0, Hour = 0, Minute = 0, Second = 0, Millisecond = 0;
  if (sc.IsReplayRunning())
    SCDateTimeMS(sc.GetEndingDateTimeForBarIndex(sc.ArraySize - 1)).GetTimeHMS(Hour, Minute, Second);
  else              
    //sc.CurrentSystemDateTimeMS.GetTimeHMS(Hour, Minute, Second, MilliSecond);
    sc.CurrentSystemDateTimeMS.GetDateTimeYMDHMS_MS(Year,Month,Day,Hour, Minute, Second, MilliSecond);

I am getting the following error:

C:\SierraChart\ACS_Source>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
Clock_milliseconds.cpp
C:\SierraChart\ACS_Source\Clock_milliseconds.cpp(66): error C2065: 'MilliSecond': undeclared identifier

Pls advice
the final goal here is to compare the time and sale clock and the local clock for latency
your help is much appreciated
Date Time Of Last Edit: 2018-06-12 19:38:03
attachmentClock_milliseconds.cpp - Attached On 2018-06-12 19:36:09 UTC - Size: 3.53 KB - 315 views