#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <math.h>

int main (int argc, char *argv[])
{
  int i = 0;
  int seconds;
  double x;

  if (argc == 2) {
    seconds = atoi (argv[1]);
  } else {
    printf ("Usage: alarm [duration in seconds]\n");
    exit (-1);
  }

  alarm (seconds);

  while (1) {
    i++;
    x = cos ((double) i);
  } 
}
