cara menampilkan waktu berjalan di c++

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

void wait(int seconds);

void wait(int seconds)
{
clock_t tunggu;
tunggu = clock() + seconds * CLOCKS_PER_SEC;
while (clock() < tunggu) {}
}

main()
{
time_t waktu;

int a;

for (a=1;a<=2;a++)
{
time (&waktu);
printf(“time now:\n%s”,ctime(&waktu));
a=a-1;
printf(“\n\nby : Annisa Shabrina”);
wait(1);
system(“CLS”);
}
getch();
}


One Response to “cara menampilkan waktu berjalan di c++”

  1. hihihi… keren nih bu refrensinya !kita newbie nih masih smt 1…!!! di tunggu bu programnya lagi hehehe..!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: