Closed lolbinarycat closed 1 year ago
Nice trick with the "|". You're right. And when I use 100000 msec it takes 1.87 seconds on my Macbook. It should take 100 seconds.
MSEC is implemented using a busy wait loop. It was calibrated on an 25 MHz CPU in the 90's. Computers have gotten faster. I should move MSEC to the pForth kernel and implement it using usleep(1000*n).
MSEC not named MS, as the standard would say?
MSEC was written in the 80's before the standard. I will add ": MS msec ;" as part of a FACILITY word set.
Also see old bug report at: https://code.google.com/archive/p/pforth/issues/16
I implemented it so that if (SLEEP) is unimplemented on embedded systems then it will use the old busy loop code.
this can be verified by running
echo "1000 msec bye" | time pforth
pforth version: PForth V28-LE/64, built May 26 2022 12:08:16 (static)
commit: fa8de1fa6ddd9d3c394b851ba87db15a22505bea
also, why is
MSEC
not namedMS
, as the standard would say?