# \[ANN\] hitimes 0.3.0 Released

**URL:** <https://rubytalk.org/t/ann-hitimes-0-3-0-released/49585>\
**Category:** ruby-talk\
**Created:** [12 October 2008 05:32 UTC](https://rubytalk.org/t/ann-hitimes-0-3-0-released/49585 "2008-10-12T05:32:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Hinegardner](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jeremy\_Hinegardner](https://rubytalk.org/u/Jeremy_Hinegardner)\
**Post date:** [12 October 2008 05:32 UTC](https://rubytalk.org/t/ann-hitimes-0-3-0-released/49585/1 "2008-10-12T05:32:22Z")

</div>

hitimes version 0.3.0 has been released. Now with windows support.

&nbsp;&nbsp;gem install hitimes

[http://copiousfreetime.rubyforge.org/hitimes/](http://copiousfreetime.rubyforge.org/hitimes/)

Hitimes is a fast, high resolution timer library for recording performance  
metrics. It uses the appropriate C method calls for each system to get the  
highest granularity time increments possible.

It currently supports any system with the POSIX call clock\_gettime(),  
Mac OS X and Windows.

Using Hitimes can be faster than using a series of Time.new calls, and  
it will have a much higher granularity. It is definitely faster than  
using Process.times.

{{ Release notes for Version 0.3.0 }}

\* switched to extconf for building extensions  
\* first release of windows binary gem  
\* reverted back to normal rdoc

> **···**
>
> # --
> 
> Jeremy Hinegardner [jeremy@hinegardner.org](mailto:jeremy@hinegardner.org)

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [12 October 2008 17:32 UTC](https://rubytalk.org/t/ann-hitimes-0-3-0-released/49585/2 "2008-10-12T17:32:25Z")

</div>

> hitimes version 0.3.0 has been released. Now with windows support.

Looks nice. I love how accurate it is over traditional Benchmark.

Wish list: 1.9 use, and also the ability to use the CPU clock counter  
[maybe guess or estimate the accuracy?]. That might be faster, for  
those of us that want speed over accuracy 🙂 [1] seems to use it, as an  
example. Anything to improve speed [like a C based measure, etc.]

Thanks much.  
-=R

[http://ruby-prof.rubyforge.org/](http://ruby-prof.rubyforge.org/)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Jeremy\_Hinegardner](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jeremy\_Hinegardner](https://rubytalk.org/u/Jeremy_Hinegardner)\
**Post date:** [13 October 2008 03:59 UTC](https://rubytalk.org/t/ann-hitimes-0-3-0-released/49585/3 "2008-10-13T03:59:41Z")

</div>

> \> hitimes version 0.3.0 has been released. Now with windows support.
> 
> Looks nice. I love how accurate it is over traditional Benchmark.

Thanks!

> Wish list: 1.9 use,

I'll get around to 1.9 at some point.

> and also the ability to use the CPU clock counter  
> [maybe guess or estimate the accuracy?]. That might be faster, for  
> those of us that want speed over accuracy 🙂 [1] seems to use it, as an  
> example.

It looks like ruby-prof some assembler to get its timing calls. Unfortunately I  
don't know assembler, otherwise I may have gone that route.

I went with the lowest level timing API call I could find on each system. this  
means that on Windows it uses the QueryPerformanceCounter()[1] and  
QueryPerformanceFrequency() combination, on OS X is uses UpTime()[2], and  
everything else goes to clock\_gettime()[3].

> Anything to improve speed [like a C based measure, etc.]

Patches are always welcome :-). Feel free to contribute[4].

The Interval class is pure C. I may re-implement Timer in C, but not quite yet.  
In hitimes, the fastest way to measure the execution time of a piece of code is:

&nbsp;&nbsp;duration = Interval.measure { # your code here }

If ther are faster ways to measure the execution of code, I would happy to  
incorporate them.

enjoy,

-jeremy

[1] - [QueryPerformanceCounter function - Win32 apps | Microsoft Learn](http://msdn.microsoft.com/en-us/library/ms644904.aspx)  
[2] - [http://developer.apple.com/documentation/Hardware/DeviceManagers/pci\_srvcs/pci\_cards\_drivers/PCI\_BOOK.199.html#pgfId=4848](http://developer.apple.com/documentation/Hardware/DeviceManagers/pci_srvcs/pci_cards_drivers/PCI_BOOK.199.html#pgfId=4848)  
[3] - [clock\_gettime(2) - OpenBSD manual pages](http://www.openbsd.org/cgi-bin/man.cgi?query=clock_gettime&sektion=2)  
[4] - [GitHub - copiousfreetime/hitimes: a fast, high resolution timer library for recording performance metrics](http://github.com/copiousfreetime/hitimes/tree/master)

> **···**
>
> On Mon, Oct 13, 2008 at 02:32:25AM +0900, Roger Pack wrote:
> 
> # --
> 
> Jeremy Hinegardner jeremy@hinegardner.org
