Jump to content

Recommended Posts

Posted

De curand mam imprietenit cu fostul admin al acestui forum "Rock" si mia aratat cateva chestii interesante despre variabile si am zis sa vi le impartasesc si voua.

Este vorba despre Hungarian Notation.

Iam vazut cateva coduri mai noi si a inceput sa foloseasca aceste prefixe desii eu nu prea inteleg ce e cu ele dar totusi mi sa parut folositor.

Cum mia spus si el, poate ati vazut si voi cum arata codul lui Slice, toate variabilele au un prefix si acum miam dat seama ca nu e la intamplare.

Un exemplu

{ // Put all the benchmarking code inside a block so we can use it multiple times without "variable already exist" errors.
    new
             iMeasureTime = %0, // Number of milliseconds to run the code
             iCount = 0, // Number of time the code was executed
             iTick = GetTickCount( ), // Current tick
             iStartTick, // The tick when the benchmarking started
        bool:bWarmup = true // Warmup?
    ;
    
    do { } while ( iTick == GetTickCount( ) ); // Wait and start right after the tick counter goes up (for precision)
    
    iTick = GetTickCount( );
    iStartTick = iTick;
    
    while ( iTick - iStartTick < iMeasureTime || bWarmup ) // While the execution time hasn't exceeded iMeasureTime or warmup
    {
        if ( bWarmup ) // If we're in a warmup..
        {
            if ( iTick - iStartTick >= iMeasureTime ) // ..and the time has passed
            {
                bWarmup = false; // No more warmup
                
                iTick = GetTickCount( );
                
                do { } while ( iTick == GetTickCount( ) ); // Wait for the next tick
                
                iTick = GetTickCount( );
                iStartTick = iTick;
                
                iCount = 0; // Reset the counter since we just did the warmup
            }
        }
        {
Mam uitat pe wikipedia in acel articol si i-ul ala vine de la
iSize : integer (Systems) or index (Apps)

b-ul de la boolean si tot asa.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.