C
C
calculator2122021-08-31 16:15:36
go
calculator212, 2021-08-31 16:15:36

How to correctly re-measure the directory traversal time?

I am doing a recursive traversal of directories, but there was such a problem that the program spends 14s of time on the first traversal, and 1s on subsequent traversals. Can I somehow make it so that the time is +/- stable?
I do a bypass through os.Walk

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Mamonov, 2021-08-31
@calculator212

Rather, every time the measurement shows the correct results despite such a difference.
I think it's in the cache of data from the disk, due to caching, repeated bypasses work faster.
To be more precise, you need to see your code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question