51 lines
No EOL
1.8 KiB
MQL5
51 lines
No EOL
1.8 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);
|
|
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
/*
|
|
2026.10.02 19:39:55.094 Misce (EURUSD,H1) @: 80848 ch: 1073741001.1651
|
|
2026.10.02 19:39:55.329 Misce (EURUSD,H1) native: 234661 ch: 1073741001.1651
|
|
2026.10.02 19:39:56.636 Misce (EURUSD,H1) @: 82353 ch: 1073741001.1651
|
|
2026.10.02 19:39:56.868 Misce (EURUSD,H1) native: 232031 ch: 1073741001.1651
|
|
*/ |