Coverage Report

Created: 2026-06-07 06:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/tdengine/include/os/osTime.h
Line
Count
Source
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15
16
#ifndef _TD_OS_TIME_H_
17
#define _TD_OS_TIME_H_
18
19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22
23
// If the error is in a third-party library, place this header file under the third-party library header file.
24
// When you want to use this feature, you should find or add the same function in the following section.
25
#ifndef ALLOW_FORBID_FUNC
26
#define strptime     STRPTIME_FUNC_TAOS_FORBID
27
#define strftime     STRFTIME_FUNC_TAOS_FORBID
28
#define gettimeofday GETTIMEOFDAY_FUNC_TAOS_FORBID
29
#define localtime    LOCALTIME_FUNC_TAOS_FORBID
30
#define localtime_s  LOCALTIMES_FUNC_TAOS_FORBID
31
#define localtime_r  LOCALTIMER_FUNC_TAOS_FORBID
32
0
#define time         TIME_FUNC_TAOS_FORBID
33
#define mktime       MKTIME_FUNC_TAOS_FORBID
34
#endif
35
36
#ifdef WINDOWS
37
38
#define CLOCK_REALTIME 0
39
#define CLOCK_MONOTONIC 0
40
41
#define MILLISECOND_PER_SECOND (1000i64)
42
#else
43
0
#define MILLISECOND_PER_SECOND ((int64_t)1000LL)
44
#endif
45
46
#include "osTimezone.h"
47
0
#define MILLISECOND_PER_MINUTE (MILLISECOND_PER_SECOND * 60)
48
0
#define MILLISECOND_PER_HOUR   (MILLISECOND_PER_MINUTE * 60)
49
0
#define MILLISECOND_PER_DAY    (MILLISECOND_PER_HOUR * 24)
50
0
#define MILLISECOND_PER_WEEK   (MILLISECOND_PER_DAY * 7)
51
52
0
#define NANOSECOND_PER_USEC   (1000LL)
53
0
#define NANOSECOND_PER_MSEC   (1000000LL)
54
0
#define NANOSECOND_PER_SEC    (1000000000LL)
55
0
#define NANOSECOND_PER_MINUTE (NANOSECOND_PER_SEC * 60)
56
0
#define NANOSECOND_PER_HOUR   (NANOSECOND_PER_MINUTE * 60)
57
0
#define NANOSECOND_PER_DAY    (NANOSECOND_PER_HOUR * 24)
58
0
#define NANOSECOND_PER_WEEK   (NANOSECOND_PER_DAY * 7)
59
60
int32_t taosGetTimeOfDay(struct timeval *tv);
61
62
int32_t taosClockGetTime(int clock_id, struct timespec *pTS);
63
64
//@return timestamp in second
65
int32_t taosGetTimestampSec();
66
67
//@return timestamp in millisecond
68
0
static FORCE_INLINE int64_t taosGetTimestampMs() {
69
0
  struct timeval systemTime;
70
0
  (void)taosGetTimeOfDay(&systemTime);
71
0
  return (int64_t)systemTime.tv_sec * 1000LL + (int64_t)systemTime.tv_usec / 1000;
72
0
}
Unexecuted instantiation: sql-fuzzer.c:taosGetTimestampMs
Unexecuted instantiation: parser.c:taosGetTimestampMs
Unexecuted instantiation: parTokenizer.c:taosGetTimestampMs
Unexecuted instantiation: parTranslater.c:taosGetTimestampMs
Unexecuted instantiation: parUtil.c:taosGetTimestampMs
Unexecuted instantiation: parAstParser.c:taosGetTimestampMs
Unexecuted instantiation: parAuthenticator.c:taosGetTimestampMs
Unexecuted instantiation: parCalcConst.c:taosGetTimestampMs
Unexecuted instantiation: parInsertSql.c:taosGetTimestampMs
Unexecuted instantiation: parInsertUtil.c:taosGetTimestampMs
Unexecuted instantiation: taos_lemon_sql.tab.c:taosGetTimestampMs
Unexecuted instantiation: parAstCreater.c:taosGetTimestampMs
Unexecuted instantiation: parInsertSml.c:taosGetTimestampMs
Unexecuted instantiation: planner.c:taosGetTimestampMs
Unexecuted instantiation: planLogicCreater.c:taosGetTimestampMs
Unexecuted instantiation: planOptimizer.c:taosGetTimestampMs
Unexecuted instantiation: planPhysiCreater.c:taosGetTimestampMs
Unexecuted instantiation: planScaleOut.c:taosGetTimestampMs
Unexecuted instantiation: planSpliter.c:taosGetTimestampMs
Unexecuted instantiation: planUtil.c:taosGetTimestampMs
Unexecuted instantiation: planValidator.c:taosGetTimestampMs
Unexecuted instantiation: catalog.c:taosGetTimestampMs
Unexecuted instantiation: ctgAsync.c:taosGetTimestampMs
Unexecuted instantiation: ctgCache.c:taosGetTimestampMs
Unexecuted instantiation: ctgDbg.c:taosGetTimestampMs
Unexecuted instantiation: ctgRemote.c:taosGetTimestampMs
Unexecuted instantiation: ctgRent.c:taosGetTimestampMs
Unexecuted instantiation: ctgUtil.c:taosGetTimestampMs
Unexecuted instantiation: functionMgt.c:taosGetTimestampMs
Unexecuted instantiation: tudf.c:taosGetTimestampMs
Unexecuted instantiation: builtins.c:taosGetTimestampMs
Unexecuted instantiation: builtinsimpl.c:taosGetTimestampMs
Unexecuted instantiation: thistogram.c:taosGetTimestampMs
Unexecuted instantiation: tpercentile.c:taosGetTimestampMs
Unexecuted instantiation: tavgfunction.c:taosGetTimestampMs
Unexecuted instantiation: tminmax.c:taosGetTimestampMs
Unexecuted instantiation: tminmaxavx.c:taosGetTimestampMs
Unexecuted instantiation: filter.c:taosGetTimestampMs
Unexecuted instantiation: scalar.c:taosGetTimestampMs
Unexecuted instantiation: sclfunc.c:taosGetTimestampMs
Unexecuted instantiation: sclvector.c:taosGetTimestampMs
Unexecuted instantiation: nodesCloneFuncs.c:taosGetTimestampMs
Unexecuted instantiation: nodesCodeFuncs.c:taosGetTimestampMs
Unexecuted instantiation: nodesEqualFuncs.c:taosGetTimestampMs
Unexecuted instantiation: nodesMatchFuncs.c:taosGetTimestampMs
Unexecuted instantiation: nodesMsgFuncs.c:taosGetTimestampMs
Unexecuted instantiation: nodesToSQLFuncs.c:taosGetTimestampMs
Unexecuted instantiation: nodesTraverseFuncs.c:taosGetTimestampMs
Unexecuted instantiation: nodesUtilFuncs.c:taosGetTimestampMs
Unexecuted instantiation: queryUtil.c:taosGetTimestampMs
Unexecuted instantiation: querymsg.c:taosGetTimestampMs
Unexecuted instantiation: trans.c:taosGetTimestampMs
Unexecuted instantiation: transCli.c:taosGetTimestampMs
Unexecuted instantiation: transComm.c:taosGetTimestampMs
Unexecuted instantiation: transSasl.c:taosGetTimestampMs
Unexecuted instantiation: transSvr.c:taosGetTimestampMs
Unexecuted instantiation: transTLS.c:taosGetTimestampMs
Unexecuted instantiation: thttp.c:taosGetTimestampMs
Unexecuted instantiation: geomFunc.c:taosGetTimestampMs
Unexecuted instantiation: geosWrapper.c:taosGetTimestampMs
Unexecuted instantiation: talgo.c:taosGetTimestampMs
Unexecuted instantiation: tarray.c:taosGetTimestampMs
Unexecuted instantiation: tbase64.c:taosGetTimestampMs
Unexecuted instantiation: tcompare.c:taosGetTimestampMs
Unexecuted instantiation: tconfig.c:taosGetTimestampMs
Unexecuted instantiation: tconv.c:taosGetTimestampMs
Unexecuted instantiation: tcrc32c.c:taosGetTimestampMs
Unexecuted instantiation: tdecompressavx.c:taosGetTimestampMs
Unexecuted instantiation: tdigest.c:taosGetTimestampMs
Unexecuted instantiation: tencode.c:taosGetTimestampMs
Unexecuted instantiation: tenv.c:taosGetTimestampMs
Unexecuted instantiation: terror.c:taosGetTimestampMs
Unexecuted instantiation: tgeosctx.c:taosGetTimestampMs
Unexecuted instantiation: thash.c:taosGetTimestampMs
Unexecuted instantiation: thashutil.c:taosGetTimestampMs
Unexecuted instantiation: theap.c:taosGetTimestampMs
Unexecuted instantiation: tjson.c:taosGetTimestampMs
Unexecuted instantiation: tlockfree.c:taosGetTimestampMs
Unexecuted instantiation: tlog.c:taosGetTimestampMs
Unexecuted instantiation: tmd5.c:taosGetTimestampMs
Unexecuted instantiation: tmempool.c:taosGetTimestampMs
Unexecuted instantiation: tpagedbuf.c:taosGetTimestampMs
Unexecuted instantiation: tqueue.c:taosGetTimestampMs
Unexecuted instantiation: tref.c:taosGetTimestampMs
Unexecuted instantiation: tsha.c:taosGetTimestampMs
Unexecuted instantiation: tsimplehash.c:taosGetTimestampMs
Unexecuted instantiation: ttimer.c:taosGetTimestampMs
Unexecuted instantiation: tunit.c:taosGetTimestampMs
Unexecuted instantiation: tutil.c:taosGetTimestampMs
Unexecuted instantiation: tuuid.c:taosGetTimestampMs
Unexecuted instantiation: tworker.c:taosGetTimestampMs
Unexecuted instantiation: mpDirect.c:taosGetTimestampMs
Unexecuted instantiation: tcompression.c:taosGetTimestampMs
Unexecuted instantiation: tcurl.c:taosGetTimestampMs
Unexecuted instantiation: tlist.c:taosGetTimestampMs
Unexecuted instantiation: tsched.c:taosGetTimestampMs
Unexecuted instantiation: systable.c:taosGetTimestampMs
Unexecuted instantiation: tanalytics.c:taosGetTimestampMs
Unexecuted instantiation: tcol.c:taosGetTimestampMs
Unexecuted instantiation: tdatablock.c:taosGetTimestampMs
Unexecuted instantiation: tdataformat.c:taosGetTimestampMs
Unexecuted instantiation: tglobal.c:taosGetTimestampMs
Unexecuted instantiation: tmisce.c:taosGetTimestampMs
Unexecuted instantiation: tname.c:taosGetTimestampMs
Unexecuted instantiation: tpriv.c:taosGetTimestampMs
Unexecuted instantiation: ttime.c:taosGetTimestampMs
Unexecuted instantiation: ttypes.c:taosGetTimestampMs
Unexecuted instantiation: tvariant.c:taosGetTimestampMs
Unexecuted instantiation: streamMsg.c:taosGetTimestampMs
Unexecuted instantiation: tmsg.c:taosGetTimestampMs
Unexecuted instantiation: xnode.c:taosGetTimestampMs
Unexecuted instantiation: tencrypt.c:taosGetTimestampMs
Unexecuted instantiation: streamJson.c:taosGetTimestampMs
Unexecuted instantiation: osAtomic.c:taosGetTimestampMs
Unexecuted instantiation: osDir.c:taosGetTimestampMs
Unexecuted instantiation: osEnv.c:taosGetTimestampMs
Unexecuted instantiation: osFile.c:taosGetTimestampMs
Unexecuted instantiation: osLocale.c:taosGetTimestampMs
Unexecuted instantiation: osMath.c:taosGetTimestampMs
Unexecuted instantiation: osMemory.c:taosGetTimestampMs
Unexecuted instantiation: osRand.c:taosGetTimestampMs
Unexecuted instantiation: osSemaphore.c:taosGetTimestampMs
Unexecuted instantiation: osSleep.c:taosGetTimestampMs
Unexecuted instantiation: osSocket.c:taosGetTimestampMs
Unexecuted instantiation: osString.c:taosGetTimestampMs
Unexecuted instantiation: osSysinfo.c:taosGetTimestampMs
Unexecuted instantiation: osThread.c:taosGetTimestampMs
Unexecuted instantiation: osTime.c:taosGetTimestampMs
Unexecuted instantiation: osTimer.c:taosGetTimestampMs
Unexecuted instantiation: osTimezone.c:taosGetTimestampMs
Unexecuted instantiation: decimal.c:taosGetTimestampMs
Unexecuted instantiation: crypt.c:taosGetTimestampMs
73
74
//@return timestamp in microsecond
75
5.33k
static FORCE_INLINE int64_t taosGetTimestampUs() {
76
5.33k
  struct timeval systemTime;
77
5.33k
  (void)taosGetTimeOfDay(&systemTime);
78
5.33k
  return (int64_t)systemTime.tv_sec * 1000000LL + (int64_t)systemTime.tv_usec;
79
5.33k
}
Unexecuted instantiation: sql-fuzzer.c:taosGetTimestampUs
Unexecuted instantiation: parser.c:taosGetTimestampUs
Unexecuted instantiation: parTokenizer.c:taosGetTimestampUs
Unexecuted instantiation: parTranslater.c:taosGetTimestampUs
Unexecuted instantiation: parUtil.c:taosGetTimestampUs
Unexecuted instantiation: parAstParser.c:taosGetTimestampUs
Unexecuted instantiation: parAuthenticator.c:taosGetTimestampUs
Unexecuted instantiation: parCalcConst.c:taosGetTimestampUs
Unexecuted instantiation: parInsertSql.c:taosGetTimestampUs
Unexecuted instantiation: parInsertUtil.c:taosGetTimestampUs
Unexecuted instantiation: taos_lemon_sql.tab.c:taosGetTimestampUs
Unexecuted instantiation: parAstCreater.c:taosGetTimestampUs
Unexecuted instantiation: parInsertSml.c:taosGetTimestampUs
Unexecuted instantiation: planner.c:taosGetTimestampUs
Unexecuted instantiation: planLogicCreater.c:taosGetTimestampUs
Unexecuted instantiation: planOptimizer.c:taosGetTimestampUs
Unexecuted instantiation: planPhysiCreater.c:taosGetTimestampUs
Unexecuted instantiation: planScaleOut.c:taosGetTimestampUs
Unexecuted instantiation: planSpliter.c:taosGetTimestampUs
Unexecuted instantiation: planUtil.c:taosGetTimestampUs
Unexecuted instantiation: planValidator.c:taosGetTimestampUs
Unexecuted instantiation: catalog.c:taosGetTimestampUs
Unexecuted instantiation: ctgAsync.c:taosGetTimestampUs
Unexecuted instantiation: ctgCache.c:taosGetTimestampUs
Unexecuted instantiation: ctgDbg.c:taosGetTimestampUs
Unexecuted instantiation: ctgRemote.c:taosGetTimestampUs
Unexecuted instantiation: ctgRent.c:taosGetTimestampUs
Unexecuted instantiation: ctgUtil.c:taosGetTimestampUs
Unexecuted instantiation: functionMgt.c:taosGetTimestampUs
Unexecuted instantiation: tudf.c:taosGetTimestampUs
Unexecuted instantiation: builtins.c:taosGetTimestampUs
Unexecuted instantiation: builtinsimpl.c:taosGetTimestampUs
Unexecuted instantiation: thistogram.c:taosGetTimestampUs
Unexecuted instantiation: tpercentile.c:taosGetTimestampUs
Unexecuted instantiation: tavgfunction.c:taosGetTimestampUs
Unexecuted instantiation: tminmax.c:taosGetTimestampUs
Unexecuted instantiation: tminmaxavx.c:taosGetTimestampUs
Unexecuted instantiation: filter.c:taosGetTimestampUs
Unexecuted instantiation: scalar.c:taosGetTimestampUs
Unexecuted instantiation: sclfunc.c:taosGetTimestampUs
Unexecuted instantiation: sclvector.c:taosGetTimestampUs
Unexecuted instantiation: nodesCloneFuncs.c:taosGetTimestampUs
Unexecuted instantiation: nodesCodeFuncs.c:taosGetTimestampUs
Unexecuted instantiation: nodesEqualFuncs.c:taosGetTimestampUs
Unexecuted instantiation: nodesMatchFuncs.c:taosGetTimestampUs
Unexecuted instantiation: nodesMsgFuncs.c:taosGetTimestampUs
Unexecuted instantiation: nodesToSQLFuncs.c:taosGetTimestampUs
Unexecuted instantiation: nodesTraverseFuncs.c:taosGetTimestampUs
Unexecuted instantiation: nodesUtilFuncs.c:taosGetTimestampUs
Unexecuted instantiation: queryUtil.c:taosGetTimestampUs
Unexecuted instantiation: querymsg.c:taosGetTimestampUs
Unexecuted instantiation: trans.c:taosGetTimestampUs
Unexecuted instantiation: transCli.c:taosGetTimestampUs
Unexecuted instantiation: transComm.c:taosGetTimestampUs
Unexecuted instantiation: transSasl.c:taosGetTimestampUs
Unexecuted instantiation: transSvr.c:taosGetTimestampUs
Unexecuted instantiation: transTLS.c:taosGetTimestampUs
Unexecuted instantiation: thttp.c:taosGetTimestampUs
Unexecuted instantiation: geomFunc.c:taosGetTimestampUs
Unexecuted instantiation: geosWrapper.c:taosGetTimestampUs
Unexecuted instantiation: talgo.c:taosGetTimestampUs
Unexecuted instantiation: tarray.c:taosGetTimestampUs
Unexecuted instantiation: tbase64.c:taosGetTimestampUs
Unexecuted instantiation: tcompare.c:taosGetTimestampUs
Unexecuted instantiation: tconfig.c:taosGetTimestampUs
Unexecuted instantiation: tconv.c:taosGetTimestampUs
Unexecuted instantiation: tcrc32c.c:taosGetTimestampUs
Unexecuted instantiation: tdecompressavx.c:taosGetTimestampUs
Unexecuted instantiation: tdigest.c:taosGetTimestampUs
Unexecuted instantiation: tencode.c:taosGetTimestampUs
Unexecuted instantiation: tenv.c:taosGetTimestampUs
Unexecuted instantiation: terror.c:taosGetTimestampUs
Unexecuted instantiation: tgeosctx.c:taosGetTimestampUs
thash.c:taosGetTimestampUs
Line
Count
Source
75
5.33k
static FORCE_INLINE int64_t taosGetTimestampUs() {
76
5.33k
  struct timeval systemTime;
77
5.33k
  (void)taosGetTimeOfDay(&systemTime);
78
5.33k
  return (int64_t)systemTime.tv_sec * 1000000LL + (int64_t)systemTime.tv_usec;
79
5.33k
}
Unexecuted instantiation: thashutil.c:taosGetTimestampUs
Unexecuted instantiation: theap.c:taosGetTimestampUs
Unexecuted instantiation: tjson.c:taosGetTimestampUs
Unexecuted instantiation: tlockfree.c:taosGetTimestampUs
Unexecuted instantiation: tlog.c:taosGetTimestampUs
Unexecuted instantiation: tmd5.c:taosGetTimestampUs
Unexecuted instantiation: tmempool.c:taosGetTimestampUs
Unexecuted instantiation: tpagedbuf.c:taosGetTimestampUs
Unexecuted instantiation: tqueue.c:taosGetTimestampUs
Unexecuted instantiation: tref.c:taosGetTimestampUs
Unexecuted instantiation: tsha.c:taosGetTimestampUs
Unexecuted instantiation: tsimplehash.c:taosGetTimestampUs
Unexecuted instantiation: ttimer.c:taosGetTimestampUs
Unexecuted instantiation: tunit.c:taosGetTimestampUs
Unexecuted instantiation: tutil.c:taosGetTimestampUs
Unexecuted instantiation: tuuid.c:taosGetTimestampUs
Unexecuted instantiation: tworker.c:taosGetTimestampUs
Unexecuted instantiation: mpDirect.c:taosGetTimestampUs
Unexecuted instantiation: tcompression.c:taosGetTimestampUs
Unexecuted instantiation: tcurl.c:taosGetTimestampUs
Unexecuted instantiation: tlist.c:taosGetTimestampUs
Unexecuted instantiation: tsched.c:taosGetTimestampUs
Unexecuted instantiation: systable.c:taosGetTimestampUs
Unexecuted instantiation: tanalytics.c:taosGetTimestampUs
Unexecuted instantiation: tcol.c:taosGetTimestampUs
Unexecuted instantiation: tdatablock.c:taosGetTimestampUs
Unexecuted instantiation: tdataformat.c:taosGetTimestampUs
Unexecuted instantiation: tglobal.c:taosGetTimestampUs
Unexecuted instantiation: tmisce.c:taosGetTimestampUs
Unexecuted instantiation: tname.c:taosGetTimestampUs
Unexecuted instantiation: tpriv.c:taosGetTimestampUs
Unexecuted instantiation: ttime.c:taosGetTimestampUs
Unexecuted instantiation: ttypes.c:taosGetTimestampUs
Unexecuted instantiation: tvariant.c:taosGetTimestampUs
Unexecuted instantiation: streamMsg.c:taosGetTimestampUs
Unexecuted instantiation: tmsg.c:taosGetTimestampUs
Unexecuted instantiation: xnode.c:taosGetTimestampUs
Unexecuted instantiation: tencrypt.c:taosGetTimestampUs
Unexecuted instantiation: streamJson.c:taosGetTimestampUs
Unexecuted instantiation: osAtomic.c:taosGetTimestampUs
Unexecuted instantiation: osDir.c:taosGetTimestampUs
Unexecuted instantiation: osEnv.c:taosGetTimestampUs
Unexecuted instantiation: osFile.c:taosGetTimestampUs
Unexecuted instantiation: osLocale.c:taosGetTimestampUs
Unexecuted instantiation: osMath.c:taosGetTimestampUs
Unexecuted instantiation: osMemory.c:taosGetTimestampUs
Unexecuted instantiation: osRand.c:taosGetTimestampUs
Unexecuted instantiation: osSemaphore.c:taosGetTimestampUs
Unexecuted instantiation: osSleep.c:taosGetTimestampUs
Unexecuted instantiation: osSocket.c:taosGetTimestampUs
Unexecuted instantiation: osString.c:taosGetTimestampUs
Unexecuted instantiation: osSysinfo.c:taosGetTimestampUs
Unexecuted instantiation: osThread.c:taosGetTimestampUs
Unexecuted instantiation: osTime.c:taosGetTimestampUs
Unexecuted instantiation: osTimer.c:taosGetTimestampUs
Unexecuted instantiation: osTimezone.c:taosGetTimestampUs
Unexecuted instantiation: decimal.c:taosGetTimestampUs
Unexecuted instantiation: crypt.c:taosGetTimestampUs
80
81
//@return timestamp in nanosecond
82
0
static FORCE_INLINE int64_t taosGetTimestampNs() {
83
0
  struct timespec systemTime = {0};
84
0
  (void)taosClockGetTime(CLOCK_REALTIME, &systemTime);
85
0
  return (int64_t)systemTime.tv_sec * 1000000000LL + (int64_t)systemTime.tv_nsec;
86
0
}
Unexecuted instantiation: sql-fuzzer.c:taosGetTimestampNs
Unexecuted instantiation: parser.c:taosGetTimestampNs
Unexecuted instantiation: parTokenizer.c:taosGetTimestampNs
Unexecuted instantiation: parTranslater.c:taosGetTimestampNs
Unexecuted instantiation: parUtil.c:taosGetTimestampNs
Unexecuted instantiation: parAstParser.c:taosGetTimestampNs
Unexecuted instantiation: parAuthenticator.c:taosGetTimestampNs
Unexecuted instantiation: parCalcConst.c:taosGetTimestampNs
Unexecuted instantiation: parInsertSql.c:taosGetTimestampNs
Unexecuted instantiation: parInsertUtil.c:taosGetTimestampNs
Unexecuted instantiation: taos_lemon_sql.tab.c:taosGetTimestampNs
Unexecuted instantiation: parAstCreater.c:taosGetTimestampNs
Unexecuted instantiation: parInsertSml.c:taosGetTimestampNs
Unexecuted instantiation: planner.c:taosGetTimestampNs
Unexecuted instantiation: planLogicCreater.c:taosGetTimestampNs
Unexecuted instantiation: planOptimizer.c:taosGetTimestampNs
Unexecuted instantiation: planPhysiCreater.c:taosGetTimestampNs
Unexecuted instantiation: planScaleOut.c:taosGetTimestampNs
Unexecuted instantiation: planSpliter.c:taosGetTimestampNs
Unexecuted instantiation: planUtil.c:taosGetTimestampNs
Unexecuted instantiation: planValidator.c:taosGetTimestampNs
Unexecuted instantiation: catalog.c:taosGetTimestampNs
Unexecuted instantiation: ctgAsync.c:taosGetTimestampNs
Unexecuted instantiation: ctgCache.c:taosGetTimestampNs
Unexecuted instantiation: ctgDbg.c:taosGetTimestampNs
Unexecuted instantiation: ctgRemote.c:taosGetTimestampNs
Unexecuted instantiation: ctgRent.c:taosGetTimestampNs
Unexecuted instantiation: ctgUtil.c:taosGetTimestampNs
Unexecuted instantiation: functionMgt.c:taosGetTimestampNs
Unexecuted instantiation: tudf.c:taosGetTimestampNs
Unexecuted instantiation: builtins.c:taosGetTimestampNs
Unexecuted instantiation: builtinsimpl.c:taosGetTimestampNs
Unexecuted instantiation: thistogram.c:taosGetTimestampNs
Unexecuted instantiation: tpercentile.c:taosGetTimestampNs
Unexecuted instantiation: tavgfunction.c:taosGetTimestampNs
Unexecuted instantiation: tminmax.c:taosGetTimestampNs
Unexecuted instantiation: tminmaxavx.c:taosGetTimestampNs
Unexecuted instantiation: filter.c:taosGetTimestampNs
Unexecuted instantiation: scalar.c:taosGetTimestampNs
Unexecuted instantiation: sclfunc.c:taosGetTimestampNs
Unexecuted instantiation: sclvector.c:taosGetTimestampNs
Unexecuted instantiation: nodesCloneFuncs.c:taosGetTimestampNs
Unexecuted instantiation: nodesCodeFuncs.c:taosGetTimestampNs
Unexecuted instantiation: nodesEqualFuncs.c:taosGetTimestampNs
Unexecuted instantiation: nodesMatchFuncs.c:taosGetTimestampNs
Unexecuted instantiation: nodesMsgFuncs.c:taosGetTimestampNs
Unexecuted instantiation: nodesToSQLFuncs.c:taosGetTimestampNs
Unexecuted instantiation: nodesTraverseFuncs.c:taosGetTimestampNs
Unexecuted instantiation: nodesUtilFuncs.c:taosGetTimestampNs
Unexecuted instantiation: queryUtil.c:taosGetTimestampNs
Unexecuted instantiation: querymsg.c:taosGetTimestampNs
Unexecuted instantiation: trans.c:taosGetTimestampNs
Unexecuted instantiation: transCli.c:taosGetTimestampNs
Unexecuted instantiation: transComm.c:taosGetTimestampNs
Unexecuted instantiation: transSasl.c:taosGetTimestampNs
Unexecuted instantiation: transSvr.c:taosGetTimestampNs
Unexecuted instantiation: transTLS.c:taosGetTimestampNs
Unexecuted instantiation: thttp.c:taosGetTimestampNs
Unexecuted instantiation: geomFunc.c:taosGetTimestampNs
Unexecuted instantiation: geosWrapper.c:taosGetTimestampNs
Unexecuted instantiation: talgo.c:taosGetTimestampNs
Unexecuted instantiation: tarray.c:taosGetTimestampNs
Unexecuted instantiation: tbase64.c:taosGetTimestampNs
Unexecuted instantiation: tcompare.c:taosGetTimestampNs
Unexecuted instantiation: tconfig.c:taosGetTimestampNs
Unexecuted instantiation: tconv.c:taosGetTimestampNs
Unexecuted instantiation: tcrc32c.c:taosGetTimestampNs
Unexecuted instantiation: tdecompressavx.c:taosGetTimestampNs
Unexecuted instantiation: tdigest.c:taosGetTimestampNs
Unexecuted instantiation: tencode.c:taosGetTimestampNs
Unexecuted instantiation: tenv.c:taosGetTimestampNs
Unexecuted instantiation: terror.c:taosGetTimestampNs
Unexecuted instantiation: tgeosctx.c:taosGetTimestampNs
Unexecuted instantiation: thash.c:taosGetTimestampNs
Unexecuted instantiation: thashutil.c:taosGetTimestampNs
Unexecuted instantiation: theap.c:taosGetTimestampNs
Unexecuted instantiation: tjson.c:taosGetTimestampNs
Unexecuted instantiation: tlockfree.c:taosGetTimestampNs
Unexecuted instantiation: tlog.c:taosGetTimestampNs
Unexecuted instantiation: tmd5.c:taosGetTimestampNs
Unexecuted instantiation: tmempool.c:taosGetTimestampNs
Unexecuted instantiation: tpagedbuf.c:taosGetTimestampNs
Unexecuted instantiation: tqueue.c:taosGetTimestampNs
Unexecuted instantiation: tref.c:taosGetTimestampNs
Unexecuted instantiation: tsha.c:taosGetTimestampNs
Unexecuted instantiation: tsimplehash.c:taosGetTimestampNs
Unexecuted instantiation: ttimer.c:taosGetTimestampNs
Unexecuted instantiation: tunit.c:taosGetTimestampNs
Unexecuted instantiation: tutil.c:taosGetTimestampNs
Unexecuted instantiation: tuuid.c:taosGetTimestampNs
Unexecuted instantiation: tworker.c:taosGetTimestampNs
Unexecuted instantiation: mpDirect.c:taosGetTimestampNs
Unexecuted instantiation: tcompression.c:taosGetTimestampNs
Unexecuted instantiation: tcurl.c:taosGetTimestampNs
Unexecuted instantiation: tlist.c:taosGetTimestampNs
Unexecuted instantiation: tsched.c:taosGetTimestampNs
Unexecuted instantiation: systable.c:taosGetTimestampNs
Unexecuted instantiation: tanalytics.c:taosGetTimestampNs
Unexecuted instantiation: tcol.c:taosGetTimestampNs
Unexecuted instantiation: tdatablock.c:taosGetTimestampNs
Unexecuted instantiation: tdataformat.c:taosGetTimestampNs
Unexecuted instantiation: tglobal.c:taosGetTimestampNs
Unexecuted instantiation: tmisce.c:taosGetTimestampNs
Unexecuted instantiation: tname.c:taosGetTimestampNs
Unexecuted instantiation: tpriv.c:taosGetTimestampNs
Unexecuted instantiation: ttime.c:taosGetTimestampNs
Unexecuted instantiation: ttypes.c:taosGetTimestampNs
Unexecuted instantiation: tvariant.c:taosGetTimestampNs
Unexecuted instantiation: streamMsg.c:taosGetTimestampNs
Unexecuted instantiation: tmsg.c:taosGetTimestampNs
Unexecuted instantiation: xnode.c:taosGetTimestampNs
Unexecuted instantiation: tencrypt.c:taosGetTimestampNs
Unexecuted instantiation: streamJson.c:taosGetTimestampNs
Unexecuted instantiation: osAtomic.c:taosGetTimestampNs
Unexecuted instantiation: osDir.c:taosGetTimestampNs
Unexecuted instantiation: osEnv.c:taosGetTimestampNs
Unexecuted instantiation: osFile.c:taosGetTimestampNs
Unexecuted instantiation: osLocale.c:taosGetTimestampNs
Unexecuted instantiation: osMath.c:taosGetTimestampNs
Unexecuted instantiation: osMemory.c:taosGetTimestampNs
Unexecuted instantiation: osRand.c:taosGetTimestampNs
Unexecuted instantiation: osSemaphore.c:taosGetTimestampNs
Unexecuted instantiation: osSleep.c:taosGetTimestampNs
Unexecuted instantiation: osSocket.c:taosGetTimestampNs
Unexecuted instantiation: osString.c:taosGetTimestampNs
Unexecuted instantiation: osSysinfo.c:taosGetTimestampNs
Unexecuted instantiation: osThread.c:taosGetTimestampNs
Unexecuted instantiation: osTime.c:taosGetTimestampNs
Unexecuted instantiation: osTimer.c:taosGetTimestampNs
Unexecuted instantiation: osTimezone.c:taosGetTimestampNs
Unexecuted instantiation: decimal.c:taosGetTimestampNs
Unexecuted instantiation: crypt.c:taosGetTimestampNs
87
88
//@return timestamp of monotonic clock in millisecond
89
0
static FORCE_INLINE int64_t taosGetMonoTimestampMs() {
90
0
  struct timespec systemTime = {0};
91
  (void)taosClockGetTime(CLOCK_MONOTONIC, &systemTime);
92
0
  return (int64_t)systemTime.tv_sec * 1000LL + (int64_t)systemTime.tv_nsec / 1000000;
93
0
}
Unexecuted instantiation: sql-fuzzer.c:taosGetMonoTimestampMs
Unexecuted instantiation: parser.c:taosGetMonoTimestampMs
Unexecuted instantiation: parTokenizer.c:taosGetMonoTimestampMs
Unexecuted instantiation: parTranslater.c:taosGetMonoTimestampMs
Unexecuted instantiation: parUtil.c:taosGetMonoTimestampMs
Unexecuted instantiation: parAstParser.c:taosGetMonoTimestampMs
Unexecuted instantiation: parAuthenticator.c:taosGetMonoTimestampMs
Unexecuted instantiation: parCalcConst.c:taosGetMonoTimestampMs
Unexecuted instantiation: parInsertSql.c:taosGetMonoTimestampMs
Unexecuted instantiation: parInsertUtil.c:taosGetMonoTimestampMs
Unexecuted instantiation: taos_lemon_sql.tab.c:taosGetMonoTimestampMs
Unexecuted instantiation: parAstCreater.c:taosGetMonoTimestampMs
Unexecuted instantiation: parInsertSml.c:taosGetMonoTimestampMs
Unexecuted instantiation: planner.c:taosGetMonoTimestampMs
Unexecuted instantiation: planLogicCreater.c:taosGetMonoTimestampMs
Unexecuted instantiation: planOptimizer.c:taosGetMonoTimestampMs
Unexecuted instantiation: planPhysiCreater.c:taosGetMonoTimestampMs
Unexecuted instantiation: planScaleOut.c:taosGetMonoTimestampMs
Unexecuted instantiation: planSpliter.c:taosGetMonoTimestampMs
Unexecuted instantiation: planUtil.c:taosGetMonoTimestampMs
Unexecuted instantiation: planValidator.c:taosGetMonoTimestampMs
Unexecuted instantiation: catalog.c:taosGetMonoTimestampMs
Unexecuted instantiation: ctgAsync.c:taosGetMonoTimestampMs
Unexecuted instantiation: ctgCache.c:taosGetMonoTimestampMs
Unexecuted instantiation: ctgDbg.c:taosGetMonoTimestampMs
Unexecuted instantiation: ctgRemote.c:taosGetMonoTimestampMs
Unexecuted instantiation: ctgRent.c:taosGetMonoTimestampMs
Unexecuted instantiation: ctgUtil.c:taosGetMonoTimestampMs
Unexecuted instantiation: functionMgt.c:taosGetMonoTimestampMs
Unexecuted instantiation: tudf.c:taosGetMonoTimestampMs
Unexecuted instantiation: builtins.c:taosGetMonoTimestampMs
Unexecuted instantiation: builtinsimpl.c:taosGetMonoTimestampMs
Unexecuted instantiation: thistogram.c:taosGetMonoTimestampMs
Unexecuted instantiation: tpercentile.c:taosGetMonoTimestampMs
Unexecuted instantiation: tavgfunction.c:taosGetMonoTimestampMs
Unexecuted instantiation: tminmax.c:taosGetMonoTimestampMs
Unexecuted instantiation: tminmaxavx.c:taosGetMonoTimestampMs
Unexecuted instantiation: filter.c:taosGetMonoTimestampMs
Unexecuted instantiation: scalar.c:taosGetMonoTimestampMs
Unexecuted instantiation: sclfunc.c:taosGetMonoTimestampMs
Unexecuted instantiation: sclvector.c:taosGetMonoTimestampMs
Unexecuted instantiation: nodesCloneFuncs.c:taosGetMonoTimestampMs
Unexecuted instantiation: nodesCodeFuncs.c:taosGetMonoTimestampMs
Unexecuted instantiation: nodesEqualFuncs.c:taosGetMonoTimestampMs
Unexecuted instantiation: nodesMatchFuncs.c:taosGetMonoTimestampMs
Unexecuted instantiation: nodesMsgFuncs.c:taosGetMonoTimestampMs
Unexecuted instantiation: nodesToSQLFuncs.c:taosGetMonoTimestampMs
Unexecuted instantiation: nodesTraverseFuncs.c:taosGetMonoTimestampMs
Unexecuted instantiation: nodesUtilFuncs.c:taosGetMonoTimestampMs
Unexecuted instantiation: queryUtil.c:taosGetMonoTimestampMs
Unexecuted instantiation: querymsg.c:taosGetMonoTimestampMs
Unexecuted instantiation: trans.c:taosGetMonoTimestampMs
Unexecuted instantiation: transCli.c:taosGetMonoTimestampMs
Unexecuted instantiation: transComm.c:taosGetMonoTimestampMs
Unexecuted instantiation: transSasl.c:taosGetMonoTimestampMs
Unexecuted instantiation: transSvr.c:taosGetMonoTimestampMs
Unexecuted instantiation: transTLS.c:taosGetMonoTimestampMs
Unexecuted instantiation: thttp.c:taosGetMonoTimestampMs
Unexecuted instantiation: geomFunc.c:taosGetMonoTimestampMs
Unexecuted instantiation: geosWrapper.c:taosGetMonoTimestampMs
Unexecuted instantiation: talgo.c:taosGetMonoTimestampMs
Unexecuted instantiation: tarray.c:taosGetMonoTimestampMs
Unexecuted instantiation: tbase64.c:taosGetMonoTimestampMs
Unexecuted instantiation: tcompare.c:taosGetMonoTimestampMs
Unexecuted instantiation: tconfig.c:taosGetMonoTimestampMs
Unexecuted instantiation: tconv.c:taosGetMonoTimestampMs
Unexecuted instantiation: tcrc32c.c:taosGetMonoTimestampMs
Unexecuted instantiation: tdecompressavx.c:taosGetMonoTimestampMs
Unexecuted instantiation: tdigest.c:taosGetMonoTimestampMs
Unexecuted instantiation: tencode.c:taosGetMonoTimestampMs
Unexecuted instantiation: tenv.c:taosGetMonoTimestampMs
Unexecuted instantiation: terror.c:taosGetMonoTimestampMs
Unexecuted instantiation: tgeosctx.c:taosGetMonoTimestampMs
Unexecuted instantiation: thash.c:taosGetMonoTimestampMs
Unexecuted instantiation: thashutil.c:taosGetMonoTimestampMs
Unexecuted instantiation: theap.c:taosGetMonoTimestampMs
Unexecuted instantiation: tjson.c:taosGetMonoTimestampMs
Unexecuted instantiation: tlockfree.c:taosGetMonoTimestampMs
Unexecuted instantiation: tlog.c:taosGetMonoTimestampMs
Unexecuted instantiation: tmd5.c:taosGetMonoTimestampMs
Unexecuted instantiation: tmempool.c:taosGetMonoTimestampMs
Unexecuted instantiation: tpagedbuf.c:taosGetMonoTimestampMs
Unexecuted instantiation: tqueue.c:taosGetMonoTimestampMs
Unexecuted instantiation: tref.c:taosGetMonoTimestampMs
Unexecuted instantiation: tsha.c:taosGetMonoTimestampMs
Unexecuted instantiation: tsimplehash.c:taosGetMonoTimestampMs
Unexecuted instantiation: ttimer.c:taosGetMonoTimestampMs
Unexecuted instantiation: tunit.c:taosGetMonoTimestampMs
Unexecuted instantiation: tutil.c:taosGetMonoTimestampMs
Unexecuted instantiation: tuuid.c:taosGetMonoTimestampMs
Unexecuted instantiation: tworker.c:taosGetMonoTimestampMs
Unexecuted instantiation: mpDirect.c:taosGetMonoTimestampMs
Unexecuted instantiation: tcompression.c:taosGetMonoTimestampMs
Unexecuted instantiation: tcurl.c:taosGetMonoTimestampMs
Unexecuted instantiation: tlist.c:taosGetMonoTimestampMs
Unexecuted instantiation: tsched.c:taosGetMonoTimestampMs
Unexecuted instantiation: systable.c:taosGetMonoTimestampMs
Unexecuted instantiation: tanalytics.c:taosGetMonoTimestampMs
Unexecuted instantiation: tcol.c:taosGetMonoTimestampMs
Unexecuted instantiation: tdatablock.c:taosGetMonoTimestampMs
Unexecuted instantiation: tdataformat.c:taosGetMonoTimestampMs
Unexecuted instantiation: tglobal.c:taosGetMonoTimestampMs
Unexecuted instantiation: tmisce.c:taosGetMonoTimestampMs
Unexecuted instantiation: tname.c:taosGetMonoTimestampMs
Unexecuted instantiation: tpriv.c:taosGetMonoTimestampMs
Unexecuted instantiation: ttime.c:taosGetMonoTimestampMs
Unexecuted instantiation: ttypes.c:taosGetMonoTimestampMs
Unexecuted instantiation: tvariant.c:taosGetMonoTimestampMs
Unexecuted instantiation: streamMsg.c:taosGetMonoTimestampMs
Unexecuted instantiation: tmsg.c:taosGetMonoTimestampMs
Unexecuted instantiation: xnode.c:taosGetMonoTimestampMs
Unexecuted instantiation: tencrypt.c:taosGetMonoTimestampMs
Unexecuted instantiation: streamJson.c:taosGetMonoTimestampMs
Unexecuted instantiation: osAtomic.c:taosGetMonoTimestampMs
Unexecuted instantiation: osDir.c:taosGetMonoTimestampMs
Unexecuted instantiation: osEnv.c:taosGetMonoTimestampMs
Unexecuted instantiation: osFile.c:taosGetMonoTimestampMs
Unexecuted instantiation: osLocale.c:taosGetMonoTimestampMs
Unexecuted instantiation: osMath.c:taosGetMonoTimestampMs
Unexecuted instantiation: osMemory.c:taosGetMonoTimestampMs
Unexecuted instantiation: osRand.c:taosGetMonoTimestampMs
Unexecuted instantiation: osSemaphore.c:taosGetMonoTimestampMs
Unexecuted instantiation: osSleep.c:taosGetMonoTimestampMs
Unexecuted instantiation: osSocket.c:taosGetMonoTimestampMs
Unexecuted instantiation: osString.c:taosGetMonoTimestampMs
Unexecuted instantiation: osSysinfo.c:taosGetMonoTimestampMs
Unexecuted instantiation: osThread.c:taosGetMonoTimestampMs
Unexecuted instantiation: osTime.c:taosGetMonoTimestampMs
Unexecuted instantiation: osTimer.c:taosGetMonoTimestampMs
Unexecuted instantiation: osTimezone.c:taosGetMonoTimestampMs
Unexecuted instantiation: decimal.c:taosGetMonoTimestampMs
Unexecuted instantiation: crypt.c:taosGetMonoTimestampMs
94
95
char      *taosStrpTime(const char *buf, const char *fmt, struct tm *tm);
96
size_t     taosStrfTime(char *s, size_t maxsize, char const *format, struct tm const *t);
97
struct tm *taosLocalTime(const time_t *timep, struct tm *result, char *buf, int32_t bufSize, timezone_t tz);
98
struct tm *taosGmTimeR(const time_t *timep, struct tm *result);
99
time_t     taosTimeGm(struct tm *tmp);
100
int32_t    taosTime(time_t *t);
101
time_t     taosMktime(struct tm *timep, timezone_t tz);
102
int64_t    user_mktime64(const uint32_t year, const uint32_t mon, const uint32_t day, const uint32_t hour,
103
                         const uint32_t min, const uint32_t sec, int64_t time_zone);
104
105
//struct tm *taosLocalTimeRz(timezone_t state, const time_t *timep, struct tm *result);
106
//time_t     taosMktimeRz(timezone_t state, struct tm *timep);
107
#ifdef __cplusplus
108
}
109
#endif
110
111
#endif /*_TD_OS_TIME_H_*/