Skip to content

A blocks based profiler for C language to profile how much time is spent in a block of code

Notifications You must be signed in to change notification settings

awaisjafar/blockprofile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BlockProfile : Profiling in C

The profiler contains helper functions in order to calculate how much time is elapsed ( Wall Clock Time ) for a given piece of code. Main modules of this library are as following

  • time_start( label ) - Starting the measurement of execution time for the block starting with “label”
  • time_end( label ) - End of the block initialized with time_start() function having the tag “label”
  • total_time( ) - The total amount of time for all the blocks combines. Return type of this is float
  • time_summary( ) - Total time for each individual execution block labelled
  • elapsed_time( label ) - Total time of execution for the block having tag “label”

Just include the profile.c file in your code.

Example

example.c is an exmaple piece of code that calculate the Fobinacci numbers from 1 to 43. In the end, time_summary is called to print all the modules with their corresponding wall clock times.

Note: This module doesn't take any different considerations for the Overlapping blocks

About

A blocks based profiler for C language to profile how much time is spent in a block of code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages