From 5e1967e466a55b3463ec9c6b7e9972f13f0aa452 Mon Sep 17 00:00:00 2001 From: Russ Rew Date: Fri, 12 Nov 2010 21:18:11 +0000 Subject: [PATCH] Put gettimeofday(&start_time, ...) call in the right place for meaningful timings. --- nc_test4/tst_h_many_atts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nc_test4/tst_h_many_atts.c b/nc_test4/tst_h_many_atts.c index 7d4499f80..a10c390f3 100644 --- a/nc_test4/tst_h_many_atts.c +++ b/nc_test4/tst_h_many_atts.c @@ -75,18 +75,18 @@ main() /* Open the root group. */ if ((grpid = H5Gopen2(hdfid, "/", H5P_DEFAULT)) < 0) ERR; + if (gettimeofday(&start_time, NULL)) ERR; /* Write an attribute. */ if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR; for (i = 0; i < NUM_ATTS; i++) { - if (gettimeofday(&start_time, NULL)) ERR; sprintf(name, "att_%d", i); if ((attid1 = H5Acreate2(grpid, name, H5T_NATIVE_INT, spaceid, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR; if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR; /* if (H5Aclose(attid1) < 0) ERR;*/ if(i % 1000 == 0) - { /* only print every 100th attribute name */ + { /* only print every 1000th attribute name */ if (gettimeofday(&end_time, NULL)) ERR; if (timeval_subtract(&diff_time, &end_time, &start_time)) ERR; sec = diff_time.tv_sec + 1.0e-6 * diff_time.tv_usec;