Global blocks As Long
Global block As Long
Global curPBVal As Long
Con.Write "["
for block = 0 to blocks
'do stuff
progressCallBack
next
Con.Write "]"
Sub progressCallBack()
On Error Resume Next
Dim curOf20 As Long
'we display progress scale 1-20
curOf20 = (20 * block) / blocks
If curOf20 > curPBVal Then
Con.WriteLine String(curOf20 - curPBVal, "-"), False
curPBVal = curOf20
End If
End Sub
void
spinner(int spin_seconds) {
static char const spin_chars[] = "/-\|";
unsigned long i, num_iterations = (spin_seconds * 10);
for (i=0; i<num_iterations; ++i) {
putchar(spin_chars[i % sizeof(spin_chars)]);
fflush(stdout);
usleep(100000);
putchar('\b');
}
}