59 lines
1.6 KiB
MQL5
59 lines
1.6 KiB
MQL5
//+------------------------------------------------------------------+
| |||
//| BenBase.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 "XUL.mqh"
| |||
#include "..\\FNV1-1A\\Main.mqh"
| |||
| |||
//+------------------------------------------------------------------+
| |||
//| Script program start function |
| |||
//+------------------------------------------------------------------+
| |||
void OnStart()
| |||
{
| |||
//---
| |||
union to_ul
| |||
{
| |||
uchar u32[32];
| |||
ulong u4[4];
| |||
} ul;
| |||
| |||
ulong t = 0;
| |||
| |||
| |||
| |||
ulong a = GetMicrosecondCount();
| |||
for(int i = 0; i < 100000; i++)
| |||
{
| |||
ArrayInitialize(ul.u4, i);
| |||
| |||
t += TSN::XUL::XXH64(ul.u4, 4, 0ULL);
| |||
}
| |||
ulong b = GetMicrosecondCount();
| |||
| |||
Print("xx: ", (b - a), " t: ", t);
| |||
| |||
t = 0;
| |||
| |||
a = GetMicrosecondCount();
| |||
for(int k = 0; k < 100000; k++)
| |||
{
| |||
ArrayInitialize(ul.u4, k);
| |||
| |||
ulong h = FNV_OFFSET_BASIS;
| |||
FNV1a_64_AsM_U(ul.u32, 32, h, FNV_PRIME)
| |||
t += h;
| |||
}
| |||
b = GetMicrosecondCount();
| |||
| |||
Print("1a: ", (b - a), " t: ", t);
| |||
}
| |||
//+------------------------------------------------------------------+
|