Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(731)

Side by Side Diff: src/platform/vboot_reference/tests/sha_benchmark.c

Issue 660228: Make crypto benchmark output compatible with autotest. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/platform/vboot_reference/tests/rsa_verify_benchmark.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "sha.h" 9 #include "sha.h"
10 #include "timer_utils.h" 10 #include "timer_utils.h"
(...skipping 27 matching lines...) Expand all
38 /* Iterate through all the hash functions. */ 38 /* Iterate through all the hash functions. */
39 for(i = 0; i < NUM_HASH_ALGORITHMS; i++) { 39 for(i = 0; i < NUM_HASH_ALGORITHMS; i++) {
40 StartTimer(&ct); 40 StartTimer(&ct);
41 hash_functions[i].hash(buffer, TEST_BUFFER_SIZE, digest); 41 hash_functions[i].hash(buffer, TEST_BUFFER_SIZE, digest);
42 StopTimer(&ct); 42 StopTimer(&ct);
43 43
44 msecs = GetDurationMsecs(&ct); 44 msecs = GetDurationMsecs(&ct);
45 speed = ((TEST_BUFFER_SIZE / 10e6) 45 speed = ((TEST_BUFFER_SIZE / 10e6)
46 / (msecs / 10e3)); /* Mbytes/sec */ 46 / (msecs / 10e3)); /* Mbytes/sec */
47 47
48 fprintf(stderr, "%s Time taken = %u ms, Speed = %f Mbytes/sec\n", 48 fprintf(stderr, "# %s Time taken = %u ms, Speed = %f Mbytes/sec\n",
49 hash_functions[i].description, msecs, speed); 49 hash_functions[i].description, msecs, speed);
50 fprintf(stdout, "%s:%f\n",
51 hash_functions[i].description, speed);
50 } 52 }
51 53
52 Free(digest); 54 Free(digest);
53 Free(buffer); 55 Free(buffer);
54 return 0; 56 return 0;
55 } 57 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/tests/rsa_verify_benchmark.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698