From 761369e1f7c06ebda0739cd4155a8b3897073a39 Mon Sep 17 00:00:00 2001 From: huili Date: Mon, 29 Jul 2019 18:53:17 +0800 Subject: [PATCH] [modify timestamp] --- tests/examples/c/asyncdemo.c | 6 +++--- tests/examples/c/demo.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/examples/c/asyncdemo.c b/tests/examples/c/asyncdemo.c index 0c98797cb8..1e523bd7fe 100644 --- a/tests/examples/c/asyncdemo.c +++ b/tests/examples/c/asyncdemo.c @@ -108,11 +108,11 @@ int main(int argc, char *argv[]) printf("start to insert...\n"); gettimeofday(&systemTime, NULL); - //st = systemTime.tv_sec * 1000000 + systemTime.tv_usec; + st = systemTime.tv_sec * 1000000 + systemTime.tv_usec; for (i = 0; irowsTried < points) { // for this demo, insert another record - sprintf(sql, "insert into %s values(now+%da, %d)", pTable->name, pTable->rowsTried, pTable->rowsTried); + sprintf(sql, "insert into %s values(%ld, %d)", pTable->name, 1546300800000+pTable->rowsTried*1000, pTable->rowsTried); taos_query_a(pTable->taos, sql, taos_insert_call_back, (void *)pTable); } else { diff --git a/tests/examples/c/demo.c b/tests/examples/c/demo.c index 7f2809c8b1..a0c4588e6f 100644 --- a/tests/examples/c/demo.c +++ b/tests/examples/c/demo.c @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) { // insert 10 records int i = 0; for (i = 0; i < 10; ++i) { - sprintf(qstr, "insert into m1 values (now+%ds, %d)", i, i * 10); + sprintf(qstr, "insert into m1 values (%ld, %d)", 1546300800000 + i * 1000, i * 10); if (taos_query(taos, qstr)) { printf("failed to insert row: %i, reason:%s\n", i, taos_errstr(taos)); } -- GitLab