Sha256: 5399b28bdf66332654ec24eee1448387c910211188493bca1ce796dcac6667f8

Contents?: true

Size: 1.26 KB

Versions: 76

Compression:

Stored size: 1.26 KB

Contents

#include "statistic/RhoProfiler.h"
#include "logging/RhoLog.h"

#if !defined(OS_WINDOWS) && !defined(OS_WINCE)
#include <unistd.h>
#define Sleep sleep
#endif

void testNoNameCounter(){
//    PROF_START;
//    Sleep(1000);
//    PROF_STOP;
}

void testLocalNamedCounter(){
    PROF_START("LocalCounter1");
    Sleep(2126);
    PROF_STOP("LocalCounter1");
}

void testGlobalNamedCounter(){
    PROF_CREATE_COUNTER("GlobalCounter1");

    PROF_START("GlobalCounter1");
    Sleep(1234);
    PROF_STOP("GlobalCounter1");

    PROF_START("GlobalCounter1");
    Sleep(1234);
    PROF_STOP("GlobalCounter1");

    PROF_DESTROY_COUNTER("GlobalCounter1");
}

void testGlobalNamedCounterFlush(){
    PROF_CREATE_COUNTER("GlobalCounter2");

    PROF_START("GlobalCounter2");
    Sleep(1234);
    PROF_STOP("GlobalCounter2");

    PROF_FLUSH_COUNTER("GlobalCounter2","Step1");

    PROF_START("GlobalCounter2");
    Sleep(1234);
    PROF_STOP("GlobalCounter2");

    PROF_DESTROY_COUNTER("GlobalCounter2");
}

int Func1(){
    Sleep(500);
    return 1;
}

void testProfCall(){
    int n = 0;
    PROF_CALL(n = Func1());
}

extern "C" void runAllProfilingTests() 
{
    testNoNameCounter();
    testLocalNamedCounter();
    testProfCall();
    testGlobalNamedCounter();
    testGlobalNamedCounterFlush();
}

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
rhodes-3.0.2 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.2.beta.1 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.1 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.1.beta.8 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.1.beta.7 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.1.beta.6 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.1.beta.5 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.1.beta.4 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.1.beta.3 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.1.beta.2 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.0 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.0.beta.7 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.0.beta.6 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.0.beta.5 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.0.beta.4 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.0.beta.3 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.0.beta.2 platform/shared/statistic/test/TestProfiling.cpp
rhodes-3.0.0.beta.1 platform/shared/statistic/test/TestProfiling.cpp
rhodes-2.4.1 platform/shared/statistic/test/TestProfiling.cpp
rhodes-2.4.1.beta.1 platform/shared/statistic/test/TestProfiling.cpp