Skip to content
Browse files

Made the code prettier according to some evil folks.

  • Loading branch information...
1 parent 2f59ad5 commit 8a4c636d95ba1954552ca0024ff6edf3a16f8043 @JumpNotZero committed Jan 29, 2012
Showing with 4 additions and 9 deletions.
  1. +4 −9 timer.c
View
13 timer.c
@@ -11,11 +11,6 @@
int main(int count, char* arguments[])
{
- clock_t start;
- clock_t end;
- double elapsed;
- int exitCode;
-
if (count <= 1 || count > 2)
{
printf("Erroneous arguments specified. Aborting.\n");
@@ -28,28 +23,28 @@ int main(int count, char* arguments[])
return EXIT_SUCCESS;
}
- start = clock();
+ clock_t start = clock();
if (start == -1)
{
printf("Failed to acquire a starting time reference point. Aborting.\n");
return EXIT_FAILURE;
}
- exitCode = system(arguments[1]);
+ int exitCode = system(arguments[1]);
if (exitCode == -1)
{
printf("An error was encountered when attempting to start the specified process. Aborting.\n");
return EXIT_FAILURE;
}
- end = clock();
+ clock_t end = clock();
if (end == -1)
{
printf("Failed to acquire an ending time reference point. Aborting.\n");
return EXIT_FAILURE;
}
- elapsed = ((double)(end - start)) / CLOCKS_PER_SEC;
+ double elapsed = ((double)(end - start)) / CLOCKS_PER_SEC;
printf("%s -> %s in %F second(s) with exit code %d.\n", arguments[0], arguments[1], elapsed, exitCode);

0 comments on commit 8a4c636

Please sign in to comment.
Something went wrong with that request. Please try again.