Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
UppHub
Status & Roadmap
FAQ
Authors & License
Forums
Funding U++
Search on this site











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord Logo

Timing

 

Profiling helpers

 

index.GetCount() = 32768

tm.Elapsed() = 5781

TIMING Index::FindAdd : 852.8 ms -   0.9 us (  1.0 s  / 1000000 ), min:   0.0 us, max:  20.0 ms, nesting: 1 - 1000000

TIMING AsString       :   3.5 s  -   3.5 us (  3.7 s  / 1000000 ), min:   0.0 us, max:  21.0 ms, nesting: 1 - 1000000

TIMING rand           :   0.0 us -   0.0 us (103.0 ms / 1000000 ), min:   0.0 us, max:  21.0 ms, nesting: 1 - 1000000

 

 

main.cpp

 

#include <Core/Core.h>

 

using namespace Upp;

 

CONSOLE_APP_MAIN

{

    Index<String> index;

    TimeStop tm;

    RTIMESTOP("Total runtime");

    for(int i = 0; i < 1000000; i++) {

        int x;

        String q;

        {

            RTIMING("rand");

            x = rand();

        }

        {

            RTIMING("AsString");

            q = AsString(x);

        }

        {

            RTIMING("Index::FindAdd");

            index.FindAdd(q);

        }

    }

    RDUMP(index.GetCount());

    RDUMP(tm.Elapsed());

}

 

 

 

 

Do you want to contribute?