new mql4 providing millisecond in timestamps.... - page 4

 
autoabacus:

...
Very interesting. Thank you.
 

I noticed that mt4 now has a GetMicroSecondCount(). Would this be superior to using GetTickCount function in terms of precision?

What would be the advantage/disadvantage of using vs GetMicrosecondCount() vs GetTickCount()?  Does it use more resources?  I would think the MicroSec resolution would be a superior function to MilliSec.  You can always convert MicroSec to Millisec or lower resolution, but you cannot take Millisec and get MicroSecs or higher resolution.


Why MQ suggested GTC function vs GMicroC for millisecond timestamps?  I understand that maybe before there was no GMicroC function.  But now that there is, why not update the documentation to recommend GMicroC for higher timestamp resolution?

 
4evermaat:

I noticed that mt4 now has a GetMicroSecondCount(). Would this be superior to using GetTickCount function in terms of precision?

What would be the advantage/disadvantage of using vs GetMicrosecondCount() vs GetTickCount()?  Does it use more resources?  I would think the MicroSec resolution would be a superior function to MilliSec.  You can always convert MicroSec to Millisec or lower resolution, but you cannot take Millisec and get MicroSecs or higher resolution.


Why MQ suggested GTC function vs GMicroC for millisecond timestamps?  I understand that maybe before there was no GMicroC function.  But now that there is, why not update the documentation to recommend GMicroC for higher timestamp resolution?

Seem you like to complain You asked for milliseconds and now you have microseconds. Anyway it will be better if TimeCurrent() (and other time returned from the server) returns milliseconds.

If you want to talk to Metaquotes, you should write to ServiceDesk, they very rarely reply to this forum.

 
4evermaat:

I noticed that mt4 now has a GetMicroSecondCount(). Would this be superior to using GetTickCount function in terms of precision?

What would be the advantage/disadvantage of using vs GetMicrosecondCount() vs GetTickCount()?  Does it use more resources?  I would think the MicroSec resolution would be a superior function to MilliSec.  You can always convert MicroSec to Millisec or lower resolution, but you cannot take Millisec and get MicroSecs or higher resolution.


Why MQ suggested GTC function vs GMicroC for millisecond timestamps?  I understand that maybe before there was no GMicroC function.  But now that there is, why not update the documentation to recommend GMicroC for higher timestamp resolution?

While GetTickCount is a core Windows API function (since the Windows beginning), the other function required (though simple) implementation. They are not related to each other.
 
zirkoner:

Seem you like to complain You asked for milliseconds and now you have microseconds. Anyway it will be better if TimeCurrent() (and other time returned from the server) returns milliseconds.

If you want to talk to Metaquotes, you should write to ServiceDesk, they very rarely reply to this forum.

Not complaining.  Just wondering why now that a new function is available that is more precise, they (or anyone) would still recommend the older function.  I have written to the service desk.

Ovo:
While GetTickCount is a core Windows API function (since the Windows beginning), the other function required (though simple) implementation. They are not related to each other.

What implementation does GetMicroSecondCount() use to get microsecond accuracy in timestamps?

 
4evermaat:

What implementation does GetMicroSecondCount() use to get microsecond accuracy in timestamps?

I have a clear idea how to code it, but I am not the MQ coder. Anyway, why do you need to know it if they already made it working for you?
 

To get system time as milli seconds from epoch:


#include <WinAPI\windef.mqh>
#import
"kernel32.dll" void GetSystemTimeAsFileTime(FILETIME& t); #import ulong getCurrentEpochMsc(){      FILETIME t;      GetSystemTimeAsFileTime(t);      ulong time = (long)t.dwHighDateTime << 32 | t.dwLowDateTime;      ulong diffTo1970 = 11644473600000;      return (ulong)(time * 0.0001 - diffTo1970 - TimeGMTOffset()*1000); }
 
owneroxxor: To get system time as milli seconds from epoch:

A Datetime is seconds from epoch. Cast to a long and multiply by 1000.  No need for all that.

 
William Roeder:

A Datetime is seconds from epoch. Cast to a long and multiply by 1000.  No need for all that.

You are not considering that in some cases (like mine) I needed to know the current instant (milliseconds precision) of the system to compare with a placed order TimeMsc(). In that case, what you said is not valid.

 
owneroxxor:

You are not considering that in some cases (like mine) I needed to know the current instant (milliseconds precision) of the system to compare with a placed order TimeMsc(). In that case, what you said is not valid.

Simply use GetTickCount().
Reason: