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











SourceForge.net Logo

Timing

 

Profiling helpers

 

 

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?