Hacker News new | ask | show | jobs
by casualaistudent 4994 days ago
Does "ms" mean milliseconds or microseconds? And are these times for one iteration of the code fragment?

2 milliseconds to compare two strings seems awfully slow.

1 comments

Definitely microseconds, most of my scripts with database interaction and all fully complete in around 50 milliseconds which would be impossible if string comparison took 2 milliseconds.
When you do a benchmark you usually run the code more than once. It's milliseconds. The real question is how many time the code loop.

But anyway the interesting number is how many times it's slower compared to an equivalent code.