JsonParserByLeo/Test/Ben/YamlLib.mq5

47 lines
1.7 KiB
MQL5
Raw Permalink Normal View History

2026-06-28 18:47:50 -05:00
//+------------------------------------------------------------------+
//| 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);
2026-06-29 09:01:48 -05:00
parser.CorrectPadding();
2026-06-28 18:47:50 -05:00
Sleep(1000);
ulong a = GetMicrosecondCount();
for(int i = 0; i < 1000; i++)
parser.Parse();
ulong b = GetMicrosecondCount() - a;
Print("Time: ", b);
//---
/*
2026-06-29 09:01:48 -05:00
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
2026-06-28 18:47:50 -05:00
*/
}
//+------------------------------------------------------------------+