Ignore:
Timestamp:
May 20, 2008, 6:58:12 AM (17 years ago)
Author:
[email protected]
Message:

Make the profiler use higher than millisecond resolution time-stamps.

Reviewed by Kevin McCullough.

  • kjs/DateMath.cpp:

(KJS::getCurrentUTCTime): Call getCurrentUTCTimeWithMicroseconds and
floor the result.
(KJS::getCurrentUTCTimeWithMicroseconds): Copied from the previous
implementation of getCurrentUTCTime without the floor call.

  • kjs/DateMath.h: Addded getCurrentUTCTimeWithMicroseconds.
  • profiler/ProfileNode.cpp:

(KJS::ProfileNode::ProfileNode): Use getCurrentUTCTimeWithMicroseconds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/DateMath.cpp

    r31813 r33930  
    276276double getCurrentUTCTime()
    277277{
     278    return floor(getCurrentUTCTimeWithMicroseconds());
     279}
     280
     281double getCurrentUTCTimeWithMicroseconds()
     282{
    278283#if PLATFORM(WIN_OS)
     284    // FIXME: the implementation for Windows is only millisecond resolution.
    279285#if COMPILER(BORLAND)
    280286    struct timeb timebuffer;
     
    288294    struct timeval tv;
    289295    gettimeofday(&tv, 0);
    290     double utc = floor(tv.tv_sec * msPerSecond + tv.tv_usec / 1000);
     296    double utc = tv.tv_sec * msPerSecond + tv.tv_usec / 1000.0;
    291297#endif
    292298    return utc;
Note: See TracChangeset for help on using the changeset viewer.