Ignore:
Timestamp:
Jul 27, 2007, 1:33:05 AM (18 years ago)
Author:
hausmann
Message:

Implemented currentTime() in the interpreter by using QDateTime, so that we don't need timeGetTime() on Windows and therefore also don't need to link against Winmm.dll.

File:
1 edited

Legend:

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

    r23816 r24710  
    4646#endif
    4747
     48#if PLATFORM(QT)
     49#include <QDateTime>
     50#endif
     51
    4852using namespace KJS;
    4953using namespace WTF;
     
    6064   
    6165private:
    62 #if PLATFORM(WIN_OS)
     66#if PLATFORM(QT)
     67    uint m_startTime;
     68    uint m_stopTime;
     69#elif PLATFORM(WIN_OS)
    6370    DWORD m_startTime;
    6471    DWORD m_stopTime;
     
    7279void StopWatch::start()
    7380{
    74 #if PLATFORM(WIN_OS)
     81#if PLATFORM(QT)
     82    QDateTime t = QDateTime::currentDateTime();
     83    m_startTime = t.toTime_t() * 1000 + t.time().msec();
     84#elif PLATFORM(WIN_OS)
    7585    m_startTime = timeGetTime();
    7686#else
     
    8191void StopWatch::stop()
    8292{
    83 #if PLATFORM(WIN_OS)
     93#if PLATFORM(QT)
     94    QDateTime t = QDateTime::currentDateTime();
     95    m_stopTime = t.toTime_t() * 1000 + t.time().msec();
     96#elif PLATFORM(WIN_OS)
    8497    m_stopTime = timeGetTime();
    8598#else
     
    90103long StopWatch::getElapsedMS()
    91104{
    92 #if PLATFORM(WIN_OS)
     105#if PLATFORM(WIN_OS) || PLATFORM(QT)
    93106    return m_stopTime - m_startTime;
    94107#else
Note: See TracChangeset for help on using the changeset viewer.