当前位置: 首页>>代码示例>>C++>>正文


C++ PerformanceTimer::stop方法代码示例

本文整理汇总了C++中PerformanceTimer::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ PerformanceTimer::stop方法的具体用法?C++ PerformanceTimer::stop怎么用?C++ PerformanceTimer::stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PerformanceTimer的用法示例。


在下文中一共展示了PerformanceTimer::stop方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: traceLight

// Like reference implementation of emit_photons_from_diffuse_point_light as described
// in "Realistic Image Synthesis using Photon Mapping" page 57.
void PhotonTracer::traceLight(const Light& light, int numberOfPhotons)
{
    int n = 0, c = 0;
	int c2 = numberOfPhotons/50;

	PerformanceTimer pt;
	pt.start();
    
	while (n < numberOfPhotons)
    {
        //Vector3 dir = light.emitPhoton();
        //Vector3 power = light.power() * light.color();
        //Ray ray(light.getPosition(), dir);

        PhotonRay photon = light.emitPhoton();
        Ray ray(photon.origin, photon.direction);

        int photons = tracePhoton(ray, photon.power, 0);
		n += photons;
		c += photons;

		if(c > c2)
		{
			c = 0;
			pt.stop();
			printf("%.2f seconds. %.2f %% done. Remaining: %.2f sec.\r",
				pt.elapsedSec(),
				(n/float(numberOfPhotons))*100.f, pt.elapsedSec()*(float(numberOfPhotons)/float(n) - 1));
			pt.start();
		}

    }
    _photonMap->scale_photon_power(1 / (float)numberOfPhotons); 
}
开发者ID:apartridge,项目名称:Crayon,代码行数:36,代码来源:PhotonTracer.cpp

示例2: stop

/**
 * Stop the performance tracer.
 */
void PnPBreakdown::stop(void)
{
    if (gPnPBreakdown.isRunning()) {
        gPnPBreakdown.formattedTrace("PnPBreakdown", __FUNCTION__);
        gPnPBreakdown.stop();
    }
}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:10,代码来源:PerformanceTraces.cpp

示例3: LOGD

void Shot2Shot::stop(void)
{
    if (gShot2Shot.isRunning()) {
        if (gPnPBreakdown.isRunning())
            PnPBreakdown::step("Shot2Shot::stop");
            LOGD("shot2shot latency: %lld us.", gShot2Shot.timeUs());
        gShot2Shot.stop();
    }
}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:9,代码来源:PerformanceTraces.cpp

示例4: CloseHandle

OsFile::~OsFile()
{
#ifdef _DEBUG
    PerformanceTimer t;
    t.start();
#endif

    CloseHandle(m_handle);

#ifdef _DEBUG
    t.stop();
    ms_time+= t.getElapsedTime();
#endif
}
开发者ID:grserver,项目名称:infinity,代码行数:14,代码来源:OsFile.cpp

示例5: seek

void OsFile::seek(int newFilePosition)
{
#ifdef _DEBUG
    PerformanceTimer t;
    t.start();
#endif

    if (m_offset != newFilePosition)
    {
        const DWORD result = SetFilePointer(m_handle, newFilePosition, NULL, FILE_BEGIN);
        DEBUG_FATAL(static_cast<int>(result) != newFilePosition, ("SetFilePointer failed"));
        UNREF(result);
        m_offset = newFilePosition;
    }

#ifdef _DEBUG
    t.stop();
    ms_time += t.getElapsedTime();
#endif
}
开发者ID:grserver,项目名称:infinity,代码行数:20,代码来源:OsFile.cpp

示例6: OsFile

OsFile *OsFile::open(const char *fileName, bool randomAccess)
{
#ifdef _DEBUG
    PerformanceTimer t;
    t.start();
#endif

    // attempt to open the file
    HANDLE handle = CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | (randomAccess ? FILE_FLAG_RANDOM_ACCESS : 0), NULL);

    // check to make sure the file opened sucessfully
    if (handle == INVALID_HANDLE_VALUE)
        return NULL;

#ifdef _DEBUG
    t.stop();
    ms_time += t.getElapsedTime();
#endif

    return new OsFile(handle);
}
开发者ID:grserver,项目名称:infinity,代码行数:21,代码来源:OsFile.cpp

示例7: getFileSize

int OsFile::getFileSize(const char *fileName)
{
    NOT_NULL(fileName);

#ifdef _DEBUG
    PerformanceTimer t;
    t.start();
#endif

    HANDLE handle = CreateFile(fileName, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
    if (handle == INVALID_HANDLE_VALUE)
        return -1;

    int const size = GetFileSize(handle, NULL);
    CloseHandle(handle);

#ifdef _DEBUG
    t.stop();
    ms_time += t.getElapsedTime();
#endif
    return size;
}
开发者ID:grserver,项目名称:infinity,代码行数:22,代码来源:OsFile.cpp

示例8: read

int OsFile::read(void *destinationBuffer, int numberOfBytes)
{
#ifdef _DEBUG
    PerformanceTimer t;
    t.start();
#endif

    DWORD amountReadDword;
    BOOL result = ReadFile(m_handle, destinationBuffer, static_cast<uint>(numberOfBytes), &amountReadDword, NULL);

// miles crasher hack
#if 0
    FATAL(!result, ("FileStreamerThread::processRead ReadFile failed to read '%d' bytes with error '%d'", static_cast<uint>(numberOfBytes), GetLastError()));
#else
    if(!result)
    {
        if(GetLastError() == 998) // access violation - buffer coming from miles hosed
        {
            WARNING(true,("FileStreamerThread::processRead ReadFile failed to read '%d' bytes with error '%d'", static_cast<uint>(numberOfBytes), GetLastError()));
            return 0;
        }
        else
        {
            FATAL(true, ("FileStreamerThread::processRead ReadFile failed to read '%d' bytes with error '%d'", static_cast<uint>(numberOfBytes), GetLastError()));
        }
    }
#endif
// end miles crasher hack

#ifdef _DEBUG
    t.stop();
    ms_time += t.getElapsedTime();
#endif

    m_offset += static_cast<int>(amountReadDword);
    return static_cast<int>(amountReadDword);
}
开发者ID:grserver,项目名称:infinity,代码行数:37,代码来源:OsFile.cpp


注:本文中的PerformanceTimer::stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。