MySQL 8.4.3
Source Code Documentation
my_rdtsc.h File Reference

Multi-platform timer code. More...

#include "my_inttypes.h"
#include "my_macros.h"

Go to the source code of this file.

Classes

struct  my_timer_unit_info
 Characteristics of a timer. More...
 
struct  my_timer_info
 Characteristics of all the supported timers. More...
 

Macros

#define MY_TIMER_ROUTINE_ASM_X86   1
 
#define MY_TIMER_ROUTINE_ASM_X86_64   2
 
#define MY_TIMER_ROUTINE_RDTSC   5
 
#define MY_TIMER_ROUTINE_ASM_IA64   6
 
#define MY_TIMER_ROUTINE_ASM_PPC   7
 
#define MY_TIMER_ROUTINE_GETHRTIME   9
 
#define MY_TIMER_ROUTINE_CLOCK_GETTIME   11
 
#define MY_TIMER_ROUTINE_NXGETTIME   12
 
#define MY_TIMER_ROUTINE_GETTIMEOFDAY   13
 
#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER   14
 
#define MY_TIMER_ROUTINE_GETTICKCOUNT   15
 
#define MY_TIMER_ROUTINE_TIMES   17
 
#define MY_TIMER_ROUTINE_ASM_PPC64   19
 
#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64   23
 
#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME   25
 
#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME   26
 
#define MY_TIMER_ROUTINE_ASM_AARCH64   28
 
#define MY_TIMER_ROUTINE_GET_THREAD_TIMES   29
 
#define MY_TIMER_ROUTINE_ASM_S390X   30
 

Typedefs

typedef struct my_timer_info MY_TIMER_INFO
 

Functions

ulonglong my_timer_cycles (void)
 A cycle timer. More...
 
ulonglong my_timer_nanoseconds (void)
 A namoseconds timer. More...
 
ulonglong my_timer_microseconds (void)
 A microseconds timer. More...
 
ulonglong my_timer_milliseconds (void)
 A millisecond timer. More...
 
ulonglong my_timer_ticks (void)
 A ticks timer. More...
 
ulonglong my_timer_thread_cpu (void)
 A THREAD CPU timer. More...
 
void my_timer_init (MY_TIMER_INFO *mti)
 Timer initialization function. More...
 

Detailed Description

Multi-platform timer code.

Macro Definition Documentation

◆ MY_TIMER_ROUTINE_ASM_AARCH64

#define MY_TIMER_ROUTINE_ASM_AARCH64   28

◆ MY_TIMER_ROUTINE_ASM_GCC_SPARC64

#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64   23

◆ MY_TIMER_ROUTINE_ASM_IA64

#define MY_TIMER_ROUTINE_ASM_IA64   6

◆ MY_TIMER_ROUTINE_ASM_PPC

#define MY_TIMER_ROUTINE_ASM_PPC   7

◆ MY_TIMER_ROUTINE_ASM_PPC64

#define MY_TIMER_ROUTINE_ASM_PPC64   19

◆ MY_TIMER_ROUTINE_ASM_S390X

#define MY_TIMER_ROUTINE_ASM_S390X   30

◆ MY_TIMER_ROUTINE_ASM_X86

#define MY_TIMER_ROUTINE_ASM_X86   1

◆ MY_TIMER_ROUTINE_ASM_X86_64

#define MY_TIMER_ROUTINE_ASM_X86_64   2

◆ MY_TIMER_ROUTINE_CLOCK_GETTIME

#define MY_TIMER_ROUTINE_CLOCK_GETTIME   11

◆ MY_TIMER_ROUTINE_GET_THREAD_TIMES

#define MY_TIMER_ROUTINE_GET_THREAD_TIMES   29

◆ MY_TIMER_ROUTINE_GETHRTIME

#define MY_TIMER_ROUTINE_GETHRTIME   9

◆ MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME

#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME   26

◆ MY_TIMER_ROUTINE_GETTICKCOUNT

#define MY_TIMER_ROUTINE_GETTICKCOUNT   15

◆ MY_TIMER_ROUTINE_GETTIMEOFDAY

#define MY_TIMER_ROUTINE_GETTIMEOFDAY   13

◆ MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME

#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME   25

◆ MY_TIMER_ROUTINE_NXGETTIME

#define MY_TIMER_ROUTINE_NXGETTIME   12

◆ MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER

#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER   14

◆ MY_TIMER_ROUTINE_RDTSC

#define MY_TIMER_ROUTINE_RDTSC   5

◆ MY_TIMER_ROUTINE_TIMES

#define MY_TIMER_ROUTINE_TIMES   17

Typedef Documentation

◆ MY_TIMER_INFO

typedef struct my_timer_info MY_TIMER_INFO

Function Documentation

◆ my_timer_cycles()

ulonglong my_timer_cycles ( void  )

A cycle timer.

Returns
the current timer value, in cycles.

◆ my_timer_init()

void my_timer_init ( MY_TIMER_INFO mti)

Timer initialization function.

Parameters
[out]mtithe timer characteristics.

◆ my_timer_microseconds()

ulonglong my_timer_microseconds ( void  )

A microseconds timer.

Returns
the current timer value, in microseconds.

◆ my_timer_milliseconds()

ulonglong my_timer_milliseconds ( void  )

A millisecond timer.

Returns
the current timer value, in milliseconds.

◆ my_timer_nanoseconds()

ulonglong my_timer_nanoseconds ( void  )

A namoseconds timer.

Returns
the current timer value, in nanoseconds.

◆ my_timer_thread_cpu()

ulonglong my_timer_thread_cpu ( void  )

A THREAD CPU timer.

Returns
the current timer value, in thread cpu.

A THREAD CPU timer.

Expressed in nanoseconds.

◆ my_timer_ticks()

ulonglong my_timer_ticks ( void  )

A ticks timer.

Returns
the current timer value, in ticks.