The HACK architecture does not provide any real time, so the wait function is implemented as a busy loop. Here is what they wrote in the book:
Sys.wait: This function can be implemented pragmatically, under the limitations
of the simulated Hack platform. In particular, you can use a loop that runs
approximately n milliseconds before it (and the function) returns. You will have to
time your specific computer to obtain a one millisecond wait, as this constant varies
from one CPU to another. As a result, your Sys.wait() function will not be portable,
but that’s life.