/***********************************************
 * released under (E) licensing ...            *
 *        (E) RULES AND REGULATIONS            *
 * permission to use/rewrite/add     : granted *
 * permission to trojan/steal        : denied  *
 * permission to use illegally       : denied  *
 * permission to use on /dev/urandom : denied  *
 ***********************************************/
/* contact el8@press.co.jp for full license    */
/* code copyrighted by ~el8 -- don't infringe! */

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

int
main (int argc, char *argv[])
{
  struct timespec speed;
  char buff[1024];
  char *sec, *nsec;
  register int x;
  if (argc>1){
      sec           = strtok(argv[1],".");
      nsec          = strtok(NULL,"\0");
      if (*sec=='\0') sec = argv[1];
      if (*nsec=='\0') nsec="0";
      speed.tv_sec  = (unsigned int)atoi(sec);
      speed.tv_nsec = atol(nsec);
  }
  else {
      speed.tv_sec  = 0;
      speed.tv_nsec = 10;
  }

  setvbuf(stdout,(char*)NULL,_IONBF,0);

  for (;;)
    {
      bzero (&buff, sizeof buff);
      if (!fgets (buff,sizeof buff,stdin))
	break;

      for (x=0;x<=strlen(buff);x++)
	{
	  if (isprint(buff[x])) // faster ANSI code output. [only \033
	                        // will be caught though :(          ]
	      nanosleep(&speed,NULL);
	  write(1,&buff[x],1);
	}
    }

  return (0);
}
/* (C) ~EL8 AND MIA/POW */
/* rewritten by tMoL */


syntax highlighted by Code2HTML, v. 0.9.1