⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perftest.jc

📁 The JILRunOnly project is a simple command-line application written in ANSI-C that is intended to de
💻 JC
字号:

/*
 *	perftest.jc
 *
 *	A simple performance test. Counts 10 times from 0 to 1.000.000 and takes average time.
 */

/*
 *	Import Typelibs
 */

import stdlib;

/*
 *	function main
 */

function float main()
{
    long i;
    long j;
    long startTime;
    long duration;
    float durationF;

    stdlib::Print("Performance test: Count 10 times from 0 to 1000000 and take average.\nPlease wait...");

    startTime = stdlib::GetTicks();
    for( j = 0; j < 10; j++ )
    {
        for( i = 0; i < 1000000; i++ );
    }
    duration = stdlib::GetTicks() - startTime;
    durationF = duration / 10.0;

    stdlib::Print("\n");
    stdlib::Printf("Execution time is %d ms\nAverage time is %g ms\n", {duration, durationF} );

	return durationF;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -