I made a simple .dll file that has only one exported function which returns the text string "1".
Then I executed the following:
d = world.timeofday
for (var/i = 1 to 100000) call("mydll", "function")("5 + 5")
world.log << "Test took [world.timeofday - d] ticks."
The above test case takes 2 ticks, even though the DLL doesn't do any actual processing.
When the number goes even higher I end up having to wait 30 seconds. This seems odd since all this is supposed to be doing is calling a function that returns a static value.
I don't know if I'm doing anything wrong, so if I am please point that out. But AFAIK this is a bug with the way BYOND talks to the DLL.
I expected the calls to finish within 0 ticks even if the loops were in the millions or billions.
Something is causing a delay of 2 ticks in the above case. Since I'm only returning a static value I'm assuming that this is something BYOND does that I can't see.
Does the problem occur:
Every time? Or how often?
In other games?
I have a reproducible test case.
In other user accounts?
On other computers?
When does the problem NOT occur?
The problem does not occur if the amount of loops is low enough. However, for my test case I was using a higher value as I want to compare BYOND's native functionality against the one I can provide through the use of a DLL file. This delay is skewing the results.