Ordering of messages and their color in WASM

I see a strange ordering, doing something nonstandard,
write/1 without flush_output/0 and nl/0 before a time/1.
Was using this code:

write('case3, swi: '), time((between(1,20000,_),
        case3(_, X, Y), Y =\= X, fail; true)),

On Unix I see:

case3, swi:
% % 2,040,001 inferences, 0.255 CPU in 0.255 seconds (100% CPU, 7997893 Lips)

On WASM I see the time output first, and what I wrote later:

% 2,041,429 inferences, 1.040 CPU in 1.040 seconds (100% CPU, 1962912 Lips)
case3, swi: 

Should I add a flush_output/0 or nl/0. Also I wonder whether it
would be possible to just append the time output, and have the
time output a color that doesn’t indicate an error?

Like in normal SWI-Prolog where its green which I guess is chosen
for informative output? Here you see the coloring. BTW: The
new collapse expand is cute!

Unbenannt

flush_output/0 doesn’t seem to work in the wasm version. Not sure why that is. Emscripten itself only deals with whole-line output. It provides a more low level interface that seems to deal with flushing, but it appears it doesn’t work as advertised. Of course that could be a mistake in my interface.