progs/rspit.c: Update the baton more frequently if we can.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 22 Dec 2014 20:32:58 +0000 (20:32 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 22 Mar 2015 01:02:46 +0000 (01:02 +0000)
progs/rspit.c

index 6dd36d6..67913d5 100644 (file)
@@ -1209,7 +1209,7 @@ static int generate(grand *r, mp *outsz,
        up = 1;
 
       if (!outsz) {
-       if (now - last > 1.0) {
+       if (now - last > 0.1) {
          up = 1;
        }
        if (up)
@@ -1221,7 +1221,7 @@ static int generate(grand *r, mp *outsz,
        mp_div(&t, 0, t, outsz);
        assert(!MP_NEGP(t) && MP_CMP(t, <, MP_UINT_MAX));
        pc = mp_touint(t);
-       if (pc > percent || percent > 100 || now - last > 1.0) {
+       if (pc > percent || percent > 100 || now - last > 0.1) {
          if (percent > 100)
            percent = 0;
          percent &= ~1;
@@ -1256,7 +1256,7 @@ static int generate(grand *r, mp *outsz,
       if (percent > 100)
        percent = 0;
 
-      if (percent < 100) {
+      if (percent < 100 && up) {
        putc(*bp++, stderr);
        putc('\b', stderr);
        if (!*bp)