Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speed fox test code
Message
De
05/06/2001 11:02:49
Mike Mattos
Nationwide Computers
Mississauga, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Speed fox test code
Divers
Thread ID:
00515121
Message ID:
00515121
Vues:
42
this code illustrates a delay problem, the "server" responds in about one second, the client takes about 5 seconds ! All suggestions welcome

the test environment was to access the client from a different computer.


SERVER

CREATE TABLE servtab (t1 c(8),t2 c(8), t3 c(8), new l)
use servtab shared
DO WHILE reccount() < 10
=sleeper(1) && sleep 1 second
GO TOP
LOCATE FOR new
IF FOUND()
REPLACE t2 WITH TIME() , new WITH .F.
FLUSH
ENDIF
ENDDO
brow
use

PROCEDURE sleeper
PARAMETER secs
DECLARE Sleep IN Win32API INTEGER nMilliseconds
nmilliseconds = secs * 1000
=sleep(nmilliseconds)



CLIENT

USE servtab shared
DO WHILE RECCOUNT() < 10
APPEND BLANK
REPLACE new WITH .T., t1 WITH TIME()
trecno=RECNO()
FLUSH
go top
inloop=1
DO WHILE inloop < 120 && exit after 2 minutes
=sleeper(1) && sleep 1 second
go trecno
IF .not. new && if server processed record
REPLACE t3 WITH TIME()
flush
go top
inloop=121
endif
ENDDO

ENDDO
use
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform