| 
                    
                 | 
                              
                              
                
                    The issue about clock() function???
                     
                         
                    
                 
               | 
              
          
        
        
        
         
        
        
        
         
            
              | 
                
                 01/12/2011 9:13 PM 
                post82069 
               | 
                            
                              
                The issue about clock() function???
                     
                         
                    
                 
                Hi, guys
I used the clock() to measure the time of my function would take. The time_used was about 1s, but the actual wallclock 
time is about 20s in the real world. Is there some issue about clock function or a wrong CLOCKS_PER_SEC defined in <time
.h>?
My code is as follows:
    start_time = clock();
          DoSomething();
     stop_time = clock();
    float time_used = 0.0f;
    time_used = (float)((float)(stop_time - start_time)/(float)CLOCKS_PER_SEC);
BR
Jerry
              
                  
                 
               | 
            
            
              | 
                
                
               | 
            
          
            
              |               
                
               |