MQLArticles/Utils/FA/String/Misce.mq5
2026-09-12 19:41:52 -05:00

45 lines
1.5 KiB
MQL5

//+------------------------------------------------------------------+
//| Misce.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
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include "Conv.mqh"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
double v;
ulong a = GetMicrosecondCount();
for(int i = 1; i < (1 << 30); i += 1000)
{
const string str = string(i) + ".1651";
int pos = 0;
TSN::CStringConvert::ToValue(str, pos, v, StringLen(str));
}
ulong b = GetMicrosecondCount();
Print("@: ", (b - a), " ch: ", v);
a = GetMicrosecondCount();
for(int i = 1; i < (1 << 30); i += 1000)
{
const string str = string(i) + ".1651";
v = StringToDouble(str);
}
b = GetMicrosecondCount();
Print("native: ", (b - a), " ch: ", v);
}
//+------------------------------------------------------------------+