Just popping in
|
@Deniil
I can tell you that under MSYS/MinGW, your loop produces unique output every ~56 occurrences, which corresponds to a Windows (PC clock) tick of ~18 ms. Without further evidence to the contrary, I would say the Bash while loop executes every tick, regardless of system speed. Variations would be caused by outside factors. So, ignore my comments about Cygwin as they don't apply in this case. (Cygwin is in fact slower than MinGW and other Windows-native APIs, which is particularly noticeable when making large projects like GCC.)
Linux should have a default tick of 1 ms (1000 Hz). You may have changed the tick rate in your kernel, or Bash (or whatever shell you're using) may behave differently on your system.
EDIT: My point here is the question you're actually answering with your experiment is, "What is the iteration rate of a Bash while-loop?"
EDIT2: I'm beginning to sound like a Windows pundit (and really, I am), but a similar construct using a batch file, a custom date command, and a port of BSD's uniq produces unique output ~420 times per second. Another similar construct using JScript produces unique output ~520 times per second. Again, it's entirely dependent on how quickly your host environment, i.e. your shell, can spawn processes, not your operating system.
Edited by Trev on 2010/10/8 19:09:49 Edited by Trev on 2010/10/8 21:50:01
|