secho substitute echo for your novelty secho.c

/***************************************************************************
 *  secho.c  Copyright (C) 2009 by hashi            NOVELTY WARE           *
 *           unix shell tool substitute for echo "sexy echo"               *
 ***************************************************************************/

/***************************************************************************
 *  yourshell$ cc secho.c -o secho && cp secho <path of executable dir>;   *
 ***************************************************************************/

#define DELAY  15 /* This is the denominator of a fraction of a second. */
                  /* The original is 15 as in 1/15 of a second delay.   */
                  /* Therefore a lower number is slower and zero is     */
                  /* not an option here. A value of one here means      */
                  /* the delay is one second. This would be ridiculous  */
                  /* as such a delay could be scripted and a C program  */
                  /* is a waste of time in this case.                   */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int main(int argc, char *argv[])
{
        int x=0;
        int y=0;
        int ctr=0;
        char* p=NULL;
        clock_t split=0;
        clock_t cpu_clocks=0;
        if(argc>1){
                for(x=1; x<argc; x++){
                        p=argv[x];
                        if(x>1){
                                putchar(' ');
                                fflush(stdout);
                                ctr++;
                                for(split=0; split<ctr; split=cpu_clocks/(CLOCKS_PER_SEC/DELAY))
                                        cpu_clocks=clock();
                        }
                        for(y=0; y<strlen(p); y++){
                                putchar(*(p+y));
                                fflush(stdout);
                                ctr++;
                                for(split=0; split<ctr; split=cpu_clocks/(CLOCKS_PER_SEC/DELAY))
                                        cpu_clocks=clock();
                        }
                }
                putchar('\n');
        }

  return 0;
}



Instead of spinlocking until time passes, why not use usleep?

i was looking for this function thanks for the tip had no idea what it was called thats why

cheers