Discussion:
[fricas-devel] [PATCH] make HyperDoc showing examples faster in xterm
oldk1331
2018-10-18 10:50:29 UTC
Permalink
diff --git a/src/hyper/spadint.c b/src/hyper/spadint.c
index fb031fc7..9ca1208e 100644
--- a/src/hyper/spadint.c
+++ b/src/hyper/spadint.c
@@ -150,7 +150,7 @@
depend->spadcom->type);
while (!gIsEndOfOutput)
pause();
- sleep(1);
+ fricas_sleep(100);
}
}
}
@@ -216,7 +216,7 @@
*/
}
accept_menu_server_connection(page);
- sleep(2);
+ fricas_sleep(100);
}



There is a delay between you click an expression in HyperDoc examples
and when the expression shows up. It was 2 seconds which is too big.

This delay is necessary because we should send the expression after
xterm is ready. The CPU is much faster than 20 years before, so we can
shorten this delay by using fricas_sleep.


"fricas_sleep" in src/lib/sockio-c.c is defined as following:

/* The function sleep is not available under Windows. Instead they
have Sleep(), with capital S, please. Furthermore, it does not
take argument in second, but in milliseconds, three order
of magnitude of difference when compared to the Unix world.
We abstract over that difference here. */

void
fricas_sleep(int n)
{
#ifdef __WIN32__
Sleep(n);
#else
struct timeval timeout;
timeout.tv_sec = n / 1000;
timeout.tv_usec = (n % 1000)*1000;
select(0, 0, 0, 0, &timeout);
#endif
}
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Waldek Hebisch
2018-10-19 15:33:16 UTC
Permalink
OK, please commit.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Loading...