Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- void delay(unsigned int mseconds)
- {
- clock_t goal = mseconds + clock();
- while (goal > clock());
- }
- int main(void)
- {
- int hora=0,segundo=0, minuto=0;
- for(segundo = 0; segundo <60; segundo++)
- {
- delay( 1000000 );//aqui pusimos 1000x1000
- system("clear");//aqui limpiamos pantalla
- cout<<hora<<" : "<<minuto<<" : "<<segundo<<endl;
- //printf("%d : %d : %d",hora, minuto, segundo);
- if(segundo == 59)
- {
- segundo=0;
- minuto = minuto + 1;
- }
- if(minuto == 59)
- {
- segundo=0;
- minuto = 0;
- hora = hora + 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement