[b]este es mi codigo[/b]
 
 
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <time.h>
#include <windows.h>
 
using namespace std;
 
void tiempo(char *app, char intervalo[2]);
 
int main(int argc, char *argv[])
{
 
    tiempo(argv[1], argv[2]);
  
    system("PAUSE");
    return EXIT_SUCCESS;
}
 
void tiempo(char *app, char intervalo[2])
{
 
 int sgn = 0;
 
 while(1){
  time_t tiempo;
  char cad[80];
  struct tm *tmPtr;
 
  tiempo = time(NULL);
  tmPtr = localtime(&tiempo);
  strftime( cad, 80, "%H:%M.%S, %A de %B de %Y", tmPtr );
 
  printf( "La hora local es: %s\n", asctime(tmPtr) );
  printf( "La hora y fecha locales son: %s\n", cad );
  
  sgn++;
  if (sgn == intervalo)
  {
    system(app);
  }
 
  Sleep(1000);
 }  
 
}