The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled C Code
Posted by: jeff | December 14, 2010 @ 2:57am
C Code
[
Download
]
#include <stdio.h> void pauseSec(int); main() { int k; int i; int waited; int goalInput; int j; int elapsed; printf("\nPlease enter the amount of seconds to wait: "); scanf("%d", &goalInput); i = time(NULL); k = time(NULL) + goalInput; while (time(NULL)<k) { pauseSec(1); waited = time(NULL) - i; printf("\nSeconds waited: %d\n", waited); printf("Time left: %d out of %d seconds.\n", goalInput - waited, goalInput); } printf("\nTotal seconds of your life just wasted: %d\n", waited); } //function defnitions: void pauseSec(int seconds) { int elapsed; int j; j = time(NULL); do{ elapsed = time(NULL); } while((elapsed-j)<seconds); }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.32 / 8
28 Votes
http://codebin.yi.org/1008
page generated in 0.00 seconds