File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 3535
3636# define  WIN32_LEAN_AND_MEAN 
3737
38- static  uint64_t   _timer_freq  =  { 0 } ;
38+ static  double   _timer_scale  =  .0 ;
3939
4040#elif  PHP_HRTIME_PLATFORM_APPLE 
4141
@@ -65,7 +65,7 @@ static int _timer_init()
6565	if  (!QueryPerformanceFrequency (& tf ) ||  0  ==  tf .QuadPart ) {
6666		return  -1 ;
6767	}
68- 	_timer_freq  =  (uint64_t )tf .QuadPart ;
68+ 	_timer_scale  =  (double ) NANO_IN_SEC  / ( php_hrtime_t )tf .QuadPart ;
6969
7070#elif  PHP_HRTIME_PLATFORM_APPLE 
7171
@@ -114,13 +114,9 @@ PHP_MINIT_FUNCTION(hrtime)
114114static  zend_always_inline  php_hrtime_t  _timer_current (void )
115115{/*{{{*/ 
116116#if  PHP_HRTIME_PLATFORM_WINDOWS 
117- 	php_hrtime_t  ret ;
118117	LARGE_INTEGER  lt  =  {0 };
119118	QueryPerformanceCounter (& lt );
120- 	ret  =  (php_hrtime_t )lt .QuadPart ;
121- 	ret  *= (php_hrtime_t )NANO_IN_SEC ;
122- 	ret  /= _timer_freq ;
123- 	return  ret ;
119+ 	return  (php_hrtime_t )((php_hrtime_t )lt .QuadPart  *  _timer_scale );
124120#elif  PHP_HRTIME_PLATFORM_APPLE 
125121	return  (php_hrtime_t )mach_absolute_time () *  _timerlib_info .numer  / _timerlib_info .denom ;
126122#elif  PHP_HRTIME_PLATFORM_POSIX 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments