Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, October 17, 2026

Diff for libplaton/platon/misc/rdtsc.h between version 1.7 and 1.8

version 1.7, 2002/07/31 00:49:36 version 1.8, 2002/09/19 23:18:00
Line 1 
Line 1 
 #ifndef _PLATON_UTILS_RDTSC_H  /**
 #define _PLATON_UTILS_RDTSC_H   * @file        misc/rdtsc.h
    * @brief       Code max/min/avg time spend counting
 /*   * @author      Lynx ??? <mizon@centrum.sk>
  * $Id$   * @author      Lubomir Host <rajo@host.sk>
    * @author      Ondrej Jombik <nepto@pobox.sk>
    * @version     \$Id$
    * @date        2001-2002
  */   */
   
 #define RDTSC_FIRST     0 /* set the first results; default behaviour */  #ifndef _PLATON_MISC_RDTSC_H
 #define RDTSC_MIN       1 /* set the shortest result */  #define _PLATON_MISC_RDTSC_H
 #define RDTSC_MAX       2 /* set the longest result */  
 #define RDTSC_AVG       3 /* set the average result */  /**
    * @name        Result types
    * @internal dummy text to make silly Doxygen happy
    */
   /*@{*/
   #define RDTSC_FIRST     0 /**< First result; default behaviour */
   #define RDTSC_MIN       1 /**< Shortest result */
   #define RDTSC_MAX       2 /**< Longest result */
   #define RDTSC_AVG       3 /**< Average result */
   /*@}*/
   
 #ifdef __cplusplus  #ifdef __cplusplus
 extern "C" {  extern "C" {
 #endif  #endif
   
   /**
    * Get first time result of code execution
    *
    * @param       code    code to execute
    * @param       count   number of repetition
    * @retval      result  pointer to double where time result will be stored
    */
 #define rdtsc_first(code, count, result) \  #define rdtsc_first(code, count, result) \
                 rdtsc_core(RDTSC_FIRST, code, count, result)                  rdtsc_core(RDTSC_FIRST, code, count, result)
   
   /**
    * Get shortest time result from code executions
    *
    * @param       code    code to execute
    * @param       count   number of repetition
    * @retval      result  pointer to double where time result will be stored
    */
 #define rdtsc_min(code, count, result) \  #define rdtsc_min(code, count, result) \
                 rdtsc_core(RDTSC_MIN, code, count, result)                  rdtsc_core(RDTSC_MIN, code, count, result)
   
   /**
    * Get longest time result from code executions
    *
    * @param       code    code to execute
    * @param       count   number of repetition
    * @retval      result  pointer to double where time result will be stored
    */
 #define rdtsc_max(code, count, result) \  #define rdtsc_max(code, count, result) \
                 rdtsc_core(RDTSC_MAX, code, count, result)                  rdtsc_core(RDTSC_MAX, code, count, result)
   
   /**
    * Get average time result from code executions
    *
    * @param       code    code to execute
    * @param       count   number of repetition
    * @retval      result  pointer to double where time result will be stored
    */
 #define rdtsc_avg(code, count, result) \  #define rdtsc_avg(code, count, result) \
                 rdtsc_core(RDTSC_AVG, code, count, result)                  rdtsc_core(RDTSC_AVG, code, count, result)
   
   /**
    * Time spend counting core function
    *
    * @internal    dummy text to make silly Doxygen happy
    *                              this must be at the beginning, else Doxygen will f*ck this up
    * @param       type    type of result, see Result types
    *                                      (@ref RDTSC_FIRST and similar)
    * @param       code    code to execute
    * @param       count   number of repetition
    * @retval      result  pointer to double where time result will be stored
    */
 #define rdtsc_core(type, code, count, result) \  #define rdtsc_core(type, code, count, result) \
         do { \          do { \
                 unsigned long __start, __end, __i; \                  unsigned long __start, __end, __i; \
Line 55  extern "C" {
Line 106  extern "C" {
 }  }
 #endif  #endif
   
 #endif                          /* #ifndef _PLATON_UTILS_RDTSC_H */  #endif                          /* #ifndef _PLATON_MISC_RDTSC_H */
   

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top