@@ -335,7 +335,7 @@ void usage(char * argv[]) {
335
335
" -n --no-counter \033[3mDo not display the timer\033[0m\n"
336
336
" -s --no-title \033[3mDo not set the titlebar text\033[0m\n"
337
337
" -e --no-clear \033[3mDo not clear the display between frames\033[0m\n"
338
- " -u --usleep \033[3mSet how frequently the image refreshes (1 <= t <= 10)\033[0m \n"
338
+ " -d --delay \033[3mDelay image rendering by anywhere between 10ms and 1000ms \n"
339
339
" -f --frames \033[3mDisplay the requested number of frames, then quit\033[0m\n"
340
340
" -r --min-rows \033[3mCrop the animation from the top\033[0m\n"
341
341
" -R --max-rows \033[3mCrop the animation from the bottom\033[0m\n"
@@ -370,7 +370,7 @@ int main(int argc, char ** argv) {
370
370
{"no-counter" , no_argument , 0 , 'n' },
371
371
{"no-title" , no_argument , 0 , 's' },
372
372
{"no-clear" , no_argument , 0 , 'e' },
373
- {"usleep " , required_argument , 0 , 'u ' },
373
+ {"delay " , required_argument , 0 , 'd ' },
374
374
{"frames" , required_argument , 0 , 'f' },
375
375
{"min-rows" , required_argument , 0 , 'r' },
376
376
{"max-rows" , required_argument , 0 , 'R' },
@@ -381,12 +381,12 @@ int main(int argc, char ** argv) {
381
381
{0 ,0 ,0 ,0 }
382
382
};
383
383
384
- /* Determine the usleep time */
385
- useconds_t speed_divisor = 1 ;
384
+ /* Time delay in milliseconds */
385
+ int delay_ms = 90 ; // Default to original value
386
386
387
387
/* Process arguments */
388
388
int index , c ;
389
- while ((c = getopt_long (argc , argv , "eshiItnu :f:r:R:c:C:W:H:" , long_opts , & index )) != -1 ) {
389
+ while ((c = getopt_long (argc , argv , "eshiItnd :f:r:R:c:C:W:H:" , long_opts , & index )) != -1 ) {
390
390
if (!c ) {
391
391
if (long_opts [index ].flag == 0 ) {
392
392
c = long_opts [index ].val ;
@@ -415,10 +415,10 @@ int main(int argc, char ** argv) {
415
415
case 'n' :
416
416
show_counter = 0 ;
417
417
break ;
418
- case 'u ' :
419
- if (1 <= atoi (optarg ) && atoi (optarg ) <= 10 )
420
- speed_divisor = atoi (optarg );
421
- break ;
418
+ case 'd ' :
419
+ if (10 <= atoi (optarg ) && atoi (optarg ) <= 1000 )
420
+ delay_ms = atoi (optarg );
421
+ break ;
422
422
case 'f' :
423
423
frame_count = atoi (optarg );
424
424
break ;
@@ -916,7 +916,7 @@ int main(int argc, char ** argv) {
916
916
i = 0 ;
917
917
}
918
918
/* Wait */
919
- usleep (90000 / speed_divisor );
919
+ usleep (1000 * delay_ms );
920
920
}
921
921
return 0 ;
922
922
}
0 commit comments