Dne 9.2.2017 v 23:08 Ali Çehreli via Digitalmars-d-learn napsal(a):
On 02/09/2017 02:04 PM, Nestor wrote:
> I tried running each algoritm a few times through avgtime using
> different digit lengths
avgtime profiles the whole process, right? It measures everything that
is involved in that little program. At least OS starting the program,
D runtime initializing, program interacting with the console, etc.
Since you're comparing algorithms, you need to take everything else
out of the equation. A better approach is to use
std.datetime.benchmark, which would repeat just the algorithm that
you're interested in.
Ali
Yes this is important, and for example when you used shared libphobos it
makes really big difference