+ /* Calculate the time used */
+ Ticks = clock() - Ticks;
+ Sec = (unsigned) (Ticks / CLOCKS_PER_SEC);
+ Milli = ((Ticks % CLOCKS_PER_SEC) * 1000) / CLOCKS_PER_SEC;
+
+ /* Print the time used */
+ printf ("Time used: %u.%03u seconds\n", Sec, Milli);
+ printf ("Q to quit, any other key for list\n");
+
+ /* Wait for a key and print the list if not 'Q' */
+ if (ReadUpperKey () != 'Q') {
+ /* Print the result */
+ J = 0;
+ for (I = 2; I < COUNT; ++I) {
+ if (Sieve[I] == 0) {
+ printf ("%4d\n", I);
+ if (++J == 23) {
+ printf ("Q to quit, any other key continues\n");
+ if (ReadUpperKey () == 'Q') {
+ break;
+ }
+ J = 0;
+ }
+ }
+ if (kbhit() && ReadUpperKey () == 'Q') {
+ break;
+ }
+ }