JsonParserByLeo/Test/Ben/JSBLMinify.mq5

55 行
1.8 KiB
MQL5

2026-10-14 11:06:00 -05:00
//+------------------------------------------------------------------+
//| JSBLMinify.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 JSONBENCH_RUN_PARSE
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include "..\\..\\Src\\JsonNode\\JsonNode.mqh"
#include "..\\..\\Src\\JsonUtils\\JsomMinify.mqh"
#include "Def.mqh"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
uchar raw[], out[];
StringToCharArray(g_json_data, raw);
//---
const int t = ArraySize(raw);
TSN::CJsonUtils::MinifyCorrects(raw, t); // corregimos
//---
ArrayResize(out, t);
//---
Sleep(500);
ulong a = GetMicrosecondCount();
for(int i = 0; i < JSONBENCH_TOTAL_ITER_PARSE; i++)
{
int x = 0;
TSN::CJsonUtils::Minify(raw, 0, t, out, x);
}
ulong b = GetMicrosecondCount();
Sleep(250);
Print("@", (b - a));
}
//+------------------------------------------------------------------+