#calculating the time

25 messages · Page 1 of 1 (latest)

old rock
#

What is the difference between calling omp_get_wtime() and creating it inside the function?

void the_4_square(Pixel* rgbConversion, double laser_time1) { 
    int a = CAM_WIDTH;  
    int b = CAM_HEIGHT; 
    int out = 315;
    Pixel find_red;
    for (int y = 0; y < CAM_HEIGHT; y++){
        for (int x = 0; x < CAM_WIDTH; x++){
            find_red = rgbConversion[(y * CAM_WIDTH) + x];
            if (((a - x + 117) < out) && (a - y - 110) > out) {
                if (find_red.B == 255) {
                    //printf("top right\n");
                    double dors = (omp_get_wtime() - laser_time1) * 1000;
                    printf("borisdfgng of test: %5.2fms\n", dors);
                }
            }else{
                gatering_of_function(rgbConversion, x, y);
            }
        }
    }
}
crimson whaleBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

keen relic
old rock
#

when i call it omp_get_wtime outside the function. I get better time then i call it inside the function

keen relic
old rock
keen relic
#

I don't know what you mean by "better"

old rock
#

i got faster time.

keen relic
#

You have to give more exact details, cause your answers aren't clear

old rock
#

i get between 0 to 5. When i call it outside the funtion. when i inluding the time inside the funtion i get between 300 to 500.

keen relic
#

Okay, and what does the number represent? Seconds? Milliseconds?

#

And why is one better than the other to you?

old rock
keen relic
#

Well, why are you trying to get the time? What is the purpose?

old rock
#

i need to find konstant time of the laser. that why

#

the code works as it should

#

i have a thory in mine head. i am just wondering if the thory is correct or false

keen relic
#

Tell me your theory

old rock
#

the theory is that. When time is inside the funtion is calulating everything and when it is outside. It just calulating the if statment.

keen relic
#

So think of omp_get_wtime() as telling you what the time of your clock is: the time might be 5:00 PM before you called the_4_square, and the time might be 5:02 PM after the the_4_square() has finished.

old rock
#

Thank you

#

!solved