Changeset 787 for trunk/dll/error.c


Ignore:
Timestamp:
Aug 19, 2007, 11:02:37 PM (18 years ago)
Author:
Steven Levine
Message:

Rework UM_FILLSETUPLIST IDM_SAVEDIRCNRSTATE and ..._setups() logic for ticket# 109 and #31
Add GetMSecTimer()
Use GetMSecTimer in DbgMsg
Tweak notebook.ipf scanning page
Move more #pragma alloc_text statements to end of files for OpenWatcom
Delete obsoletes
Revert ExpandAll() ShowTreeRec() DosSleeps to 0 - DosSleep(1) was slowing down inner loops
Drop afFilesToGet - use FilesToGet directly
Optimze ShowTreeRec() collapse logic - was really slow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/error.c

    r689 r787  
    2525  20 Apr 07 SHL Correct IDS_GENERR1TEXT formatting
    2626  23 Apr 07 SHL Add Win_Error_NoMsgBox.  Rework others
     27  14 Aug 07 SHL Add GetMSecTimer
     28  14 Aug 07 SHL Use GetMSecTimer in DbgMsg
    2729
    2830***********************************************************************/
     
    4244
    4345#pragma data_seg(DATA1)
    44 #pragma alloc_text(FMINPUT,Win_Error,Dos_Error,saymsg,showMsg)
     46
     47static PSZ pszSrcFile = __FILE__;
    4548
    4649static VOID formatWinError(PSZ pszBuf, UINT cBufBytes, HWND hwndErr, HWND hwndOwner,
     
    5558{
    5659  va_list va;
     60
     61#if 1 // fixme to be selectable
     62
     63  static ULONG ul1stMSec;
     64  // static ULONG ulLastMSec;
     65
     66  ULONG msec = GetMSecTimer();
     67  ULONG delta;
     68
     69  if (!ul1stMSec) {
     70    ul1stMSec = msec;
     71    // ulLastMSec = msec;                       // Avoid big delta 1st time
     72  }
     73
     74  delta = msec - ul1stMSec;
     75  // ulLastMSec = msec;
     76  fprintf(stderr, "%03lu.%03lu ", delta / 1000, delta % 1000);
     77
     78#endif
    5779
    5880  // OK for source file name to be null
     
    227249} // formatWinError
    228250
     251/**
     252 * Return millisecond timer value
     253 * Resolution is milliseconds, but accuracy will be less
     254 * depending on systems settings
     255 */
     256
     257ULONG GetMSecTimer(void)
     258{
     259  ULONG msec;
     260
     261  APIRET rc = DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
     262                              &msec, sizeof(msec));
     263  if (rc) {
     264    Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     265              "DosQuerySysInfo");
     266    msec = 0;
     267  }
     268  return msec;
     269}
     270
    229271//== Runtime_Error: report runtime library error using passed message string ===
    230272
     
    363405
    364406} // Win_Error_NoMsgBox
     407
     408#pragma alloc_text(ERROR,Win_Error,Dos_Error,saymsg,showMsg,GetHiresTimeer)
Note: See TracChangeset for help on using the changeset viewer.