summaryrefslogtreecommitdiff
path: root/basic/source/runtime/methods1.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2003-04-23 15:58:20 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2003-04-23 15:58:20 +0000
commitb647cc35d3155fad86d0c75caec99c9ec96d8782 (patch)
treebf3cb8f18a0ce4181dc9abb75e5dfc476c226557 /basic/source/runtime/methods1.cxx
parentb48f220a198050405472045e6de837d5550f6ce6 (diff)
INTEGRATION: CWS uno2 (1.12.38); FILE MERGED
2003/04/11 12:14:55 ab 1.12.38.1: #108152# Use Timer and yield in RTL function Wait
Diffstat (limited to 'basic/source/runtime/methods1.cxx')
-rw-r--r--basic/source/runtime/methods1.cxx46
1 files changed, 10 insertions, 36 deletions
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index f979156530..680a18df7a 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: methods1.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: ab $ $Date: 2002-12-12 16:48:03 $
+ * last change: $Author: rt $ $Date: 2003-04-23 16:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,6 +77,9 @@
#ifndef _SV_WRKWIN_HXX
#include <vcl/wrkwin.hxx>
#endif
+#ifndef _SV_TIMER_HXX
+#include <vcl/timer.hxx>
+#endif
#ifndef _SBXVAR_HXX
#include <svtools/sbxvar.hxx>
#endif
@@ -430,41 +433,12 @@ RTLFUNC(Wait)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
-#if defined(OS2)
- ULONG nStart, nCur;
- DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT,&nStart,sizeof(ULONG) );
- // drucken wir gerade?
- int bPrinting = Sysdepen::IsMultiThread() ? TRUE : FALSE;
- do
- {
- Application::Reschedule();
- if( bPrinting )
- DosSleep( 50 ); // damit der Druck-Thread mehr CPU-Zeit bekommt
- DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT,&nCur,sizeof(ULONG) );
- } while( (nCur-nStart) < (ULONG)nWait );
-#else
- long nSeconds = nWait / 1000;
- if( !nSeconds ) nSeconds = 1;
-#if defined(UNX) || defined(WIN)
- // Unix hat kein clock()
- time_t nStart = time( 0 );
- time_t nEnd;
- do
- {
- Application::Reschedule();
- nEnd = time( 0 );
- } while( (nEnd-nStart) < nSeconds );
-#else
- clock_t nStart = clock() / CLK_TCK;
- clock_t nEnd;
- do
- {
- Application::Reschedule();
- nEnd = clock() / CLK_TCK;
- } while( (nEnd-nStart) < nSeconds );
-#endif
-#endif
+ Timer aTimer;
+ aTimer.SetTimeout( nWait );
+ aTimer.Start();
+ while ( aTimer.IsActive() )
+ Application::Yield();
}
RTLFUNC(GetGUIVersion)