Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001937OCamlOCaml generalpublic2003-11-21 20:532012-01-27 19:50
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.09.2 
Summary0001937: Unix module, binding to getrusage()
DescriptionFull_Name: Daniel B├╝nzli
Version: 3.07+2
OS: MacOS X 10.3.1
Submission from: 45.45.203.62.dial.bluewin.ch (62.203.45.45)


The resolution of Unix.times() is too low. Subtracting figures returned by two
subsequent calls to the function one often gets 0.0 (even if some code was
executed meanwhile).

# (Unix.times()).Unix.tms_utime -. (Unix.times()).Unix.tms_utime;;
- : float = 0.

Unix.gettimeofday(), has a good resolution however it doesn't enable one to make
the difference between user and system time.

# (Unix.gettimeofday()) -. (Unix.gettimeofday());;
- : float = 2.02655792236328125e-06

A binding in the Unix module to the getrusage [1] function would give user and
system times with the accuracy of gettimeofday, that is possibly down to
microseconds (actual resolution is system dependent).

Thanks for considering,

Daniel

[1] <http://www.opengroup.org/onlinepubs/007904975/functions/getrusage.html> [^]
<http://www.opengroup.org/onlinepubs/007904975/basedefs/sys/resource.h.html> [^]

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006831)
doligez (administrator)
2012-01-27 19:50

Fixed in 3.09.2 and in trunk (commit 7382): Unix.times now calls getrusage if available.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2012-01-27 19:50 doligez Note Added: 0006831
2012-01-27 19:50 doligez Status acknowledged => closed
2012-01-27 19:50 doligez Resolution open => fixed
2012-01-27 19:50 doligez Fixed in Version => 3.09.2
2012-01-27 19:50 doligez Description Updated View Revisions


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker