count_secondscount_secondsCountSecondsCountSecondscount_seconds计数秒(算子)

名称

count_secondscount_secondsCountSecondsCountSecondscount_seconds — 流逝的时间。

签名

count_seconds( : : : Seconds)

Herror count_seconds(double* Seconds)

Herror T_count_seconds(Htuple* Seconds)

void CountSeconds(HTuple* Seconds)

static double HSystem::CountSeconds()

static void HOperatorSet.CountSeconds(out HTuple seconds)

static double HSystem.CountSeconds()

def count_seconds() -> float

描述

算子 count_secondscount_secondsCountSecondsCountSecondsCountSecondscount_seconds 用于测量时间。每次调用该算子都会返回一个时间值。连续两次调用的值之差即为时间间隔(单位为秒)。可通过 set_system('clock_mode',...)set_system("clock_mode",...)SetSystem("clock_mode",...)SetSystem("clock_mode",...)SetSystem("clock_mode",...)set_system("clock_mode",...) 设置时间测量模式。

注意

时间测量不够精确,且取决于计算机的负载情况。

执行信息

参数

SecondsSecondsSecondsSecondssecondsseconds (输出控制)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

程序启动以来的处理时间。

示例(HDevelop)

count_seconds(Start)
* program segment to be measured
count_seconds(End)
Seconds := End - Start

示例(C)

count_seconds(&Start);
/* program segment to be measured */
count_seconds(&End);
printf("RunTime = %g\n",End-Start);

示例(HDevelop)

count_seconds(Start)
* program segment to be measured
count_seconds(End)
Seconds := End - Start

示例(HDevelop)

count_seconds(Start)
* program segment to be measured
count_seconds(End)
Seconds := End - Start

示例(HDevelop)

count_seconds(Start)
* program segment to be measured
count_seconds(End)
Seconds := End - Start

结果

算子 count_secondscount_secondsCountSecondsCountSecondsCountSecondscount_seconds 始终返回值 2 (H_MSG_TRUE)。

另见

set_systemset_systemSetSystemSetSystemSetSystemset_system

模块

基础