47 行
1.7 KiB
MQL5
47 行
1.7 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| YamlLib.mq5 |
|
|
//| Copyright 2026, Niquel Mendoza. |
|
|
//| https://www.mql5.com/ |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Copyright 2026, Niquel Mendoza."
|
|
#property link "https://www.mql5.com/"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//#define YAMLPARSERBYLEO_ENABLE_ESCAPED_COMMILAS_IN_KEY
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
#include "..\\..\\..\\YamlParserByLeo\\Src\\YmlNode.mqh"
|
|
#resource "twitter.json" as const string g_json_data
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Script program start function |
|
|
//+------------------------------------------------------------------+
|
|
void OnStart()
|
|
{
|
|
//---
|
|
TSN::CYamlParser parser;
|
|
// Only one copy
|
|
parser.Assing(g_json_data);
|
|
parser.CorrectPadding();
|
|
|
|
Sleep(1000);
|
|
ulong a = GetMicrosecondCount();
|
|
for(int i = 0; i < 1000; i++)
|
|
|
|
parser.Parse();
|
|
|
|
ulong b = GetMicrosecondCount() - a;
|
|
Print("Time: ", b);
|
|
|
|
//---
|
|
/*
|
|
2026.06.29 08:44:22.118 YamlLib (EURUSD,H1) Time: 1302649
|
|
2026.06.29 08:44:26.709 YamlLib (EURUSD,H1) Time: 1303311
|
|
2026.06.29 08:44:30.728 YamlLib (EURUSD,H1) Time: 1300136
|
|
2026.06.29 08:44:40.296 YamlLib (EURUSD,H1) Time: 1304638
|
|
2026.06.29 08:44:45.640 YamlLib (EURUSD,H1) Time: 1301852
|
|
*/
|
|
}
|
|
//+------------------------------------------------------------------+
|