forked from airat77786/MQL5Book
26 lines
1 KiB
MQL5
26 lines
1 KiB
MQL5
//+------------------------------------------------------------------+
| |||
//| TimeCount.mq5 |
| |||
//| Copyright 2021, MetaQuotes Ltd. |
| |||
//| https://www.mql5.com |
| |||
//+------------------------------------------------------------------+
| |||
#include "..\..\Include\PRTF.mqh"
| |||
| |||
//+------------------------------------------------------------------+
| |||
//| Script program start function |
| |||
//+------------------------------------------------------------------+
| |||
void OnStart()
| |||
{
| |||
const uint startMs = GetTickCount();
| |||
const ulong startMcs = GetMicrosecondCount();
| |||
| |||
// loop for 5 seconds
| |||
while(PRTF(GetTickCount()) < startMs + 5000)
| |||
{
| |||
PRTF(GetMicrosecondCount());
| |||
Sleep(1000);
| |||
}
| |||
| |||
PRTF(GetTickCount() - startMs);
| |||
PRTF(GetMicrosecondCount() - startMcs);
| |||
}
| |||
//+------------------------------------------------------------------+
|