2010-02-20 12:55 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* include/hbsetup.ch
* src/common/hbverdsp.c
- Deleted HB_COMPAT_FLAGSHIP, HB_COMPAT_FOXPRO.
* include/hbextern.ch
* src/rtl/seconds.c
+ Added HB_SECONDSCPU()
(native Harbour version of FlagShip specific SECONDSCPU())
* tests/memtst.prg
* tests/speedold.prg
* tests/speedtst.prg
* tests/vidtest.prg
* Changed to use HB_SECONDSCPU().
+ Added translation from SECONDSCPU() to HB_SECONDSCPU() when
built for FlagShip (where applicable).
* include/hbextern.ch
* src/rtl/Makefile
- src/rtl/strpeek.c
- src/rtl/secondfs.c
* contrib/Makefile
+ contrib/hbfship
+ contrib/hbfship/Makefile
+ contrib/hbfship/hbfship.hbc
+ contrib/hbfship/secondfs.c
+ contrib/hbfship/strpeek.c
- Moved FlagShip specific function from core to new hbfship lib.
* Changed SECONDSCPU() to be just a wrapper over core HB_SECONDSCPU().
; INCOMPATIBLE: If you used SECONDSCPU() function, change it to
HB_SECONDSCPU(), or add hbfship to your lib list.
If you used STRPEEK() or STRPOKE() functions,
add hbfship to your lib list.
* utils/hbmk2/examples/contribf.hbc
+ Added hbfship.
This commit is contained in:
@@ -17,6 +17,44 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-02-20 12:55 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* include/hbsetup.ch
|
||||
* src/common/hbverdsp.c
|
||||
- Deleted HB_COMPAT_FLAGSHIP, HB_COMPAT_FOXPRO.
|
||||
|
||||
* include/hbextern.ch
|
||||
* src/rtl/seconds.c
|
||||
+ Added HB_SECONDSCPU()
|
||||
(native Harbour version of FlagShip specific SECONDSCPU())
|
||||
|
||||
* tests/memtst.prg
|
||||
* tests/speedold.prg
|
||||
* tests/speedtst.prg
|
||||
* tests/vidtest.prg
|
||||
* Changed to use HB_SECONDSCPU().
|
||||
+ Added translation from SECONDSCPU() to HB_SECONDSCPU() when
|
||||
built for FlagShip (where applicable).
|
||||
|
||||
* include/hbextern.ch
|
||||
* src/rtl/Makefile
|
||||
- src/rtl/strpeek.c
|
||||
- src/rtl/secondfs.c
|
||||
* contrib/Makefile
|
||||
+ contrib/hbfship
|
||||
+ contrib/hbfship/Makefile
|
||||
+ contrib/hbfship/hbfship.hbc
|
||||
+ contrib/hbfship/secondfs.c
|
||||
+ contrib/hbfship/strpeek.c
|
||||
- Moved FlagShip specific function from core to new hbfship lib.
|
||||
* Changed SECONDSCPU() to be just a wrapper over core HB_SECONDSCPU().
|
||||
; INCOMPATIBLE: If you used SECONDSCPU() function, change it to
|
||||
HB_SECONDSCPU(), or add hbfship to your lib list.
|
||||
If you used STRPEEK() or STRPOKE() functions,
|
||||
add hbfship to your lib list.
|
||||
|
||||
* utils/hbmk2/examples/contribf.hbc
|
||||
+ Added hbfship.
|
||||
|
||||
2010-02-20 12:00 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/common/hbverdsp.c
|
||||
* include/hbsetup.ch
|
||||
@@ -138,7 +176,7 @@
|
||||
* Synced contrib/xpp compatibility lib source with core.
|
||||
- Deleted Xbase++ compatibility functions from core.
|
||||
; NOTE: INCOMPATIBLE. If you use Xbase++ function, you should now link
|
||||
xpp lib. (the name of the lib is not yet finalized)
|
||||
xpp lib. (the name of the lib is not yet finalized) [DONE]
|
||||
; TODO: Clean remaining four HB_COMPAT_XPP guards and delete this
|
||||
build-time option from core. [DONE]
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ DIRS := \
|
||||
hbbtree \
|
||||
hbclipsm \
|
||||
hbct \
|
||||
hbfship \
|
||||
hbgt \
|
||||
hbmemio \
|
||||
hbmisc \
|
||||
|
||||
18
harbour/contrib/hbfship/Makefile
Normal file
18
harbour/contrib/hbfship/Makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
ROOT := ../../
|
||||
|
||||
include $(TOP)$(ROOT)config/global.mk
|
||||
|
||||
LIBNAME := hbfship
|
||||
|
||||
C_SOURCES := \
|
||||
secondfs.c \
|
||||
strpeek.c \
|
||||
|
||||
PRG_SOURCES := \
|
||||
|
||||
include $(TOP)$(ROOT)config/header.mk
|
||||
include $(TOP)$(ROOT)config/lib.mk
|
||||
7
harbour/contrib/hbfship/hbfship.hbc
Normal file
7
harbour/contrib/hbfship/hbfship.hbc
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
incpaths=.
|
||||
|
||||
libs=hbfship
|
||||
@@ -51,13 +51,10 @@
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbdate.h"
|
||||
|
||||
#ifdef HB_COMPAT_FLAGSHIP
|
||||
HB_FUNC_EXTERN( HB_SECONDSCPU );
|
||||
|
||||
HB_FUNC( SECONDSCPU )
|
||||
{
|
||||
hb_retnd( hb_secondsCPU( hb_parni( 1 ) ) );
|
||||
HB_FUNC_EXEC( HB_SECONDSCPU );
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -54,8 +54,6 @@
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
|
||||
#ifdef HB_COMPAT_FLAGSHIP
|
||||
|
||||
HB_FUNC( STRPEEK )
|
||||
{
|
||||
PHB_ITEM pText = hb_param( 1, HB_IT_STRING );
|
||||
@@ -93,5 +91,3 @@ HB_FUNC( STRPOKE )
|
||||
else
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1099, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
#endif /* HB_COMPAT_FLAGSHIP */
|
||||
@@ -906,6 +906,7 @@ EXTERNAL HB_MMIDDLEDOWN
|
||||
EXTERNAL HB_STRFORMAT
|
||||
EXTERNAL HB_ALERT
|
||||
EXTERNAL HB_SETCLSHANDLE
|
||||
EXTERNAL HB_SECONDSCPU
|
||||
|
||||
EXTERNAL HB_INISETCOMMENT
|
||||
EXTERNAL HB_INIREAD
|
||||
@@ -1237,14 +1238,4 @@ EXTERNAL HBNIL
|
||||
EXTERNAL HBNUMERIC
|
||||
#endif /* HB_REQUEST_SCALAR */
|
||||
|
||||
/* FlagShip extension */
|
||||
|
||||
#ifdef HB_COMPAT_FLAGSHIP
|
||||
|
||||
EXTERNAL STRPEEK
|
||||
EXTERNAL STRPOKE
|
||||
EXTERNAL SECONDSCPU
|
||||
|
||||
#endif /* HB_COMPAT_FLAGSHIP */
|
||||
|
||||
#endif /* HB_EXTERN_CH_ */
|
||||
|
||||
@@ -56,14 +56,11 @@
|
||||
#ifndef HB_SETUP_CH_
|
||||
#define HB_SETUP_CH_
|
||||
|
||||
/* NOTE: You can select here, which features you want to include of the
|
||||
different Clipper implementations. */
|
||||
/* NOTE: You can fine-tune here, which Clipper features you want to include. */
|
||||
|
||||
/* #define HB_CLP_STRICT */ /* Enable Cl*pper 5.2e/5.3x strict compatibility */
|
||||
#define HB_CLP_UNDOC /* Enable Cl*pper 5.2e/5.3x undocumented features */
|
||||
#define HB_COMPAT_C53 /* Enable Cl*pper 5.3x extensions */
|
||||
#define HB_COMPAT_FLAGSHIP /* Enable Flagship extensions */
|
||||
/* #define HB_COMPAT_FOXPRO */ /* Enable FoxPro extensions */
|
||||
|
||||
/* ***********************************************************************
|
||||
* Leave this #define if you want to allow usage of legacy Harbour 2.0.0/Clipper
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* Display build information
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999-2010 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -162,12 +162,6 @@ void hb_verBuildInfo( void )
|
||||
#endif
|
||||
#if defined( HB_CLP_STRICT )
|
||||
hb_conOutErr( "(Clipper 5.x strict) ", 0 );
|
||||
#endif
|
||||
#if defined( HB_COMPAT_FLAGSHIP )
|
||||
hb_conOutErr( "(Flagship) ", 0 );
|
||||
#endif
|
||||
#if defined( HB_COMPAT_FOXPRO )
|
||||
hb_conOutErr( "(FoxPro) ", 0 );
|
||||
#endif
|
||||
hb_conOutErr( hb_conNewLine(), 0 );
|
||||
|
||||
|
||||
@@ -142,7 +142,6 @@ C_SOURCES := \
|
||||
saverest.c \
|
||||
scroll.c \
|
||||
scrrow.c \
|
||||
secondfs.c \
|
||||
seconds.c \
|
||||
setcolor.c \
|
||||
setcurs.c \
|
||||
@@ -163,7 +162,6 @@ C_SOURCES := \
|
||||
strcase.c \
|
||||
strclear.c \
|
||||
strmatch.c \
|
||||
strpeek.c \
|
||||
strtoexp.c \
|
||||
strtran.c \
|
||||
strxor.c \
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* SECONDS() function
|
||||
*
|
||||
* Copyright 2003 Przemyslaw Czerpak <druzus@acn.waw.pl> (HB_SECONDSCPU())
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
@@ -58,6 +59,11 @@ HB_FUNC( SECONDS )
|
||||
hb_retnd( hb_dateSeconds() );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_SECONDSCPU )
|
||||
{
|
||||
hb_retnd( hb_secondsCPU( hb_parni( 1 ) ) );
|
||||
}
|
||||
|
||||
HB_FUNC( HB_MILLISECONDS )
|
||||
{
|
||||
hb_retnint( ( HB_MAXINT ) hb_dateMilliSeconds() );
|
||||
|
||||
@@ -30,12 +30,12 @@ endif
|
||||
?
|
||||
? "testing single large memory blocks allocation and freeing..."
|
||||
nRealSec := seconds()
|
||||
nCPUSec := secondsCPU()
|
||||
nCPUSec := hb_secondsCPU()
|
||||
for i := 1 to N_LOOPS
|
||||
a := space( 50000 )
|
||||
next
|
||||
a := NIL
|
||||
nCPUSec := secondsCPU() - nCPUSec
|
||||
nCPUSec := hb_secondsCPU() - nCPUSec
|
||||
nRealSec := seconds() - nRealSec
|
||||
? " CPU time:", nCPUSec, "sec."
|
||||
? "real time:", nRealSec, "sec."
|
||||
@@ -43,7 +43,7 @@ nRealSec := seconds() - nRealSec
|
||||
?
|
||||
? "testing many large memory blocks allocation and freeing..."
|
||||
nRealSec := seconds()
|
||||
nCPUSec := secondsCPU()
|
||||
nCPUSec := hb_secondsCPU()
|
||||
a := array(100)
|
||||
for i := 1 to N_LOOPS
|
||||
a[ i % 100 + 1 ] := space( 50000 )
|
||||
@@ -52,7 +52,7 @@ for i := 1 to N_LOOPS
|
||||
endif
|
||||
next
|
||||
a := NIL
|
||||
nCPUSec := secondsCPU() - nCPUSec
|
||||
nCPUSec := hb_secondsCPU() - nCPUSec
|
||||
nRealSec := seconds() - nRealSec
|
||||
? " CPU time:", nCPUSec, "sec."
|
||||
? "real time:", nRealSec, "sec."
|
||||
@@ -63,7 +63,7 @@ nRealSec := seconds() - nRealSec
|
||||
wait
|
||||
|
||||
nRealSec := seconds()
|
||||
nCPUSec := secondsCPU()
|
||||
nCPUSec := hb_secondsCPU()
|
||||
a := {}
|
||||
for i := 1 to N_LOOPS
|
||||
aadd( a, {} )
|
||||
@@ -71,7 +71,7 @@ for i := 1 to N_LOOPS
|
||||
?? i
|
||||
endif
|
||||
next
|
||||
nCPUSec := secondsCPU() - nCPUSec
|
||||
nCPUSec := hb_secondsCPU() - nCPUSec
|
||||
nRealSec := seconds() - nRealSec
|
||||
? " CPU time:", nCPUSec, "sec."
|
||||
? "real time:", nRealSec, "sec."
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef REAL_TIME
|
||||
#xtranslate secondscpu([<x>]) => seconds()
|
||||
#xtranslate hb_secondsCPU([<x>]) => seconds()
|
||||
#endif
|
||||
#ifndef EOL
|
||||
#define EOL hb_OSNewLine()
|
||||
@@ -100,15 +100,15 @@ t:=seconds()+5; while t > seconds(); enddo
|
||||
? "ARR_LEN =", ARR_LEN
|
||||
? "N_LOOPS =", N_LOOPS
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
next
|
||||
tn:=secondscpu()-t
|
||||
tn:=hb_secondsCPU()-t
|
||||
? "empty loops overhead =", tn
|
||||
#ifdef REAL_TIME
|
||||
? "real time -> seconds()"
|
||||
#else
|
||||
? "CPU usage -> secondsCPU()"
|
||||
? "CPU usage -> hb_secondsCPU()"
|
||||
#endif
|
||||
? ""
|
||||
|
||||
@@ -153,39 +153,39 @@ L_N := 112345.67
|
||||
L_D := date()
|
||||
|
||||
|
||||
total:=secondscpu()
|
||||
total:=hb_secondsCPU()
|
||||
totalr:=seconds()
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
c:=L_C
|
||||
next
|
||||
dsp_time( "c:=L_C -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
n:=L_N
|
||||
next
|
||||
dsp_time( "n:=L_N -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
d:=L_D
|
||||
next
|
||||
dsp_time( "d:=L_D -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
c:=M_C
|
||||
next
|
||||
dsp_time( "c:=M_C -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
n:=M_N
|
||||
next
|
||||
dsp_time( "n:=M_N -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
d:=M_D
|
||||
next
|
||||
@@ -193,38 +193,38 @@ dsp_time( "d:=M_D -> ", t, tn)
|
||||
|
||||
#ifndef NO_DBF_TEST
|
||||
select(1)
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
c:=F_C
|
||||
next
|
||||
dsp_time( "(sh) c:=F_C -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
n:=F_N
|
||||
next
|
||||
dsp_time( "(sh) n:=F_N -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
d:=F_D
|
||||
next
|
||||
dsp_time( "(sh) d:=F_D -> ", t, tn)
|
||||
|
||||
select(2)
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
c:=F_C
|
||||
next
|
||||
dsp_time( "(ex) c:=F_C -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
n:=F_N
|
||||
next
|
||||
dsp_time( "(ex) n:=F_N -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
d:=F_D
|
||||
next
|
||||
@@ -232,14 +232,14 @@ dsp_time( "(ex) d:=F_D -> ", t, tn)
|
||||
#endif
|
||||
|
||||
o:=errorNew()
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
n:=o:GenCode
|
||||
next
|
||||
dsp_time( "n:=o:GenCode -> ", t, tn)
|
||||
|
||||
#ifdef __HARBOUR__
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
n:=o[8]
|
||||
next
|
||||
@@ -247,13 +247,13 @@ dsp_time( "n:=o[8] -> ", t, tn)
|
||||
#endif
|
||||
|
||||
#ifdef ASSOC_ARRAY
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
aAssoc[a2[i%ARR_LEN+1]+ltrim(str(i%100))]:=i
|
||||
next
|
||||
dsp_time( "aAssoc[a2[i%ARR_LEN+1]+ltrim(str(i%100)]:=i -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
c:=aAssoc[a2[i%ARR_LEN+1]+ltrim(str(i%100))]
|
||||
next
|
||||
@@ -261,38 +261,38 @@ dsp_time( "c:=aAssoc[a2[i%ARR_LEN+1]+ltrim(str(i%100)] -> ", t, tn)
|
||||
#endif
|
||||
|
||||
#ifndef NO_KEYBOARD_TEST
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
inkey()
|
||||
next
|
||||
dsp_time( "inkey() -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
nextkey()
|
||||
next
|
||||
dsp_time( "nextkey() -> ", t, tn)
|
||||
#endif
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
round(i/1000,2)
|
||||
next
|
||||
dsp_time( "round(i/1000,2) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
str(i/1000)
|
||||
next
|
||||
dsp_time( "str(i/1000) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
val(a3[i%ARR_LEN+1])
|
||||
next
|
||||
dsp_time( "val(a3[i%ARR_LEN+1]) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
j:=date()
|
||||
for i:=1 to N_LOOPS
|
||||
dtos(j+i%10000-5000)
|
||||
@@ -300,87 +300,87 @@ next
|
||||
dsp_time( "dtos(j+i%10000-5000) -> ", t, tn)
|
||||
|
||||
bc:={||i%ARR_LEN}
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
eval(bc)
|
||||
next
|
||||
dsp_time( "eval({||i%ARR_LEN}) -> ", t, tn)
|
||||
|
||||
bc:={|x|x%ARR_LEN}
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
eval(bc,i)
|
||||
next
|
||||
dsp_time( "eval({|x|x%ARR_LEN},i) -> ", t, tn)
|
||||
|
||||
bc:={|x|f1(x)}
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
eval(bc,i)
|
||||
next
|
||||
dsp_time( "eval({|x|f1(x)},i) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
n:=&("f1("+str(i)+")")
|
||||
next
|
||||
dsp_time( "&('f1('+str(i)+')') -> ", t, tn)
|
||||
|
||||
bc:=&("{|x|f1(x)}")
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
eval(bc,i)
|
||||
next
|
||||
dsp_time( "eval([&('{|x|f1(x)}')]) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
j:=valtype(a)+valtype(i)
|
||||
next
|
||||
dsp_time( "j := valtype(a)+valtype(i) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
j := str(i%100,2) $ a2[i%ARR_LEN+1]
|
||||
next
|
||||
dsp_time( "j := str(i%100,2) $ a2[i%ARR_LEN+1] -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
j := val(a2[i%ARR_LEN+1])
|
||||
next
|
||||
dsp_time( "j := val(a2[i%ARR_LEN+1]) -> ", t, tn)
|
||||
|
||||
c:=dtos(date())
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
j := a2[i%ARR_LEN+1] == c
|
||||
next
|
||||
dsp_time( "j := a2[i%ARR_LEN+1] == s -> ", t, tn)
|
||||
|
||||
c:=dtos(date())
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
j := a2[i%ARR_LEN+1] = c
|
||||
next
|
||||
dsp_time( "j := a2[i%ARR_LEN+1] = s -> ", t, tn)
|
||||
|
||||
c:=dtos(date())
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
j := a2[i%ARR_LEN+1] >= c
|
||||
next
|
||||
dsp_time( "j := a2[i%ARR_LEN+1] >= s -> ", t, tn)
|
||||
|
||||
c:=dtos(date())
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
j := a2[i%ARR_LEN+1] < c
|
||||
next
|
||||
dsp_time( "j := a2[i%ARR_LEN+1] < s -> ", t, tn)
|
||||
|
||||
aa:={}
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
if i%1000 == 0
|
||||
aa:={}
|
||||
@@ -389,46 +389,46 @@ for i:=1 to N_LOOPS
|
||||
next
|
||||
dsp_time( "aadd(aa,{i,j,s,a,a2,t,bc}) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f0()
|
||||
next
|
||||
dsp_time( "f0() -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f1(i)
|
||||
next
|
||||
dsp_time( "f1(i) -> ", t, tn)
|
||||
|
||||
c:=dtos(date())
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f2(c)
|
||||
next
|
||||
dsp_time( "f2(c["+ltrim(str(len(c)))+"]) -> ", t, tn)
|
||||
|
||||
c:=replicate(c,5000)
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f2(c)
|
||||
next
|
||||
dsp_time( "f2(c["+ltrim(str(len(c)))+"]) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f2(@c)
|
||||
next
|
||||
dsp_time( "f2(@c["+ltrim(str(len(c)))+"]) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f2(c)
|
||||
c2:=c
|
||||
next
|
||||
dsp_time( "f2(c["+ltrim(str(len(c)))+"]); c2:=c -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f2(@c)
|
||||
c2:=c
|
||||
@@ -436,44 +436,44 @@ next
|
||||
dsp_time( "f2(@c["+ltrim(str(len(c)))+"]); c2:=c -> ", t, tn)
|
||||
|
||||
c:=dtos(date())
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f3(a,a2,c,i,j,t,bc)
|
||||
next
|
||||
dsp_time( "f3(a,a2,c,i,j,t,bc) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
f2(a2)
|
||||
next
|
||||
dsp_time( "f2(a2) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
c:=f4()
|
||||
next
|
||||
dsp_time( "s:=f4() -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
c:=f5()
|
||||
next
|
||||
dsp_time( "s:=f5() -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
ascan(a,i%ARR_LEN)
|
||||
next
|
||||
dsp_time( "ascan(a,i%ARR_LEN) -> ", t, tn)
|
||||
|
||||
c:=dtos(date())
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
ascan(a2,c+chr(i%64+64))
|
||||
next
|
||||
dsp_time( "ascan(a2,c+chr(i%64+64)) -> ", t, tn)
|
||||
|
||||
t:=secondscpu()
|
||||
t:=hb_secondsCPU()
|
||||
for i:=1 to N_LOOPS
|
||||
ascan(a,{|x|x==i%ARR_LEN})
|
||||
next
|
||||
@@ -498,7 +498,7 @@ endif
|
||||
return nil
|
||||
|
||||
function dsp_time(s,t,tn)
|
||||
? padr(s,50)+str(max(secondscpu()-t-tn,0),8,2)
|
||||
? padr(s,50)+str(max(hb_secondsCPU()-t-tn,0),8,2)
|
||||
return nil
|
||||
|
||||
function f0(x)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define __ST__
|
||||
#endif
|
||||
/* Clipper does not have function to extract process time */
|
||||
#xtranslate secondsCPU() => seconds()
|
||||
#xtranslate hb_secondsCPU() => seconds()
|
||||
#endif
|
||||
|
||||
#ifdef FlagShip
|
||||
@@ -52,6 +52,7 @@
|
||||
#ifndef __ST__
|
||||
#define __ST__
|
||||
#endif
|
||||
#xtranslate hb_secondsCPU([<x>]) => secondsCPU([<x>])
|
||||
/* the FlagShip version of seconds() returns integer values */
|
||||
#xtranslate seconds() => fs_seconds()
|
||||
#endif
|
||||
@@ -59,7 +60,7 @@
|
||||
#ifdef __XPP__
|
||||
#define __NO_OBJ_ARRAY__
|
||||
/* Has xBase++ function to extract process time? */
|
||||
#xtranslate secondsCPU() => seconds()
|
||||
#xtranslate hb_secondsCPU() => seconds()
|
||||
#endif
|
||||
|
||||
#ifdef __CLIP__
|
||||
@@ -126,11 +127,11 @@
|
||||
[ private <privates> ; ] ;
|
||||
[ public <publics> ; ] ;
|
||||
[ <init> ; ] ;
|
||||
time := secondscpu() ; ;
|
||||
time := hb_secondsCPU() ; ;
|
||||
for i:=1 to N_LOOPS ; ;
|
||||
[ ( <testExp> ) ; ] ;
|
||||
next ; ;
|
||||
time := secondscpu() - time ; ;
|
||||
time := hb_secondsCPU() - time ; ;
|
||||
[ <exit> ; ] ;
|
||||
return { procname() + ": " + iif( <.info.>, <(info)>, #<testExp> ), time }
|
||||
|
||||
@@ -542,7 +543,7 @@ else
|
||||
endif
|
||||
|
||||
nSeconds := seconds()
|
||||
nTimes := secondsCPU()
|
||||
nTimes := hb_secondsCPU()
|
||||
|
||||
nTimeTotST := nTimeTotMT := 0
|
||||
|
||||
@@ -640,7 +641,7 @@ nTimeTotST := nTimeTotMT := 0
|
||||
next
|
||||
#endif
|
||||
|
||||
nTimes := secondsCPU() - nTimes
|
||||
nTimes := hb_secondsCPU() - nTimes
|
||||
nSeconds := seconds() - nSeconds
|
||||
|
||||
if lScale
|
||||
|
||||
@@ -15,8 +15,12 @@
|
||||
#include "box.ch"
|
||||
|
||||
#ifndef __CLIP__
|
||||
#ifndef FlagShip
|
||||
#xtranslate secondscpu([<x>]) => seconds([<x>])
|
||||
#ifdef FlagShip
|
||||
#xtranslate hb_secondsCPU([<x>]) => secondsCPU([<x>])
|
||||
#else
|
||||
#ifndef __HARBOUR__
|
||||
#xtranslate hb_secondsCPU([<x>]) => seconds([<x>])
|
||||
#endif
|
||||
#define EOL chr(13) + chr(10)
|
||||
#endif
|
||||
#endif
|
||||
@@ -66,7 +70,7 @@ static function StaticText()
|
||||
local c
|
||||
local i := 0
|
||||
local nEnd := 0
|
||||
local nStart := secondscpu()
|
||||
local nStart := hb_secondsCPU()
|
||||
|
||||
str := "Hello World - From " + Left(str,At(" ",str)-1)
|
||||
c := (MaxCol()-len(str)) / 2
|
||||
@@ -75,7 +79,7 @@ static function StaticText()
|
||||
@ r, c say str
|
||||
next i
|
||||
|
||||
nEnd := secondscpu()
|
||||
nEnd := hb_secondsCPU()
|
||||
|
||||
cResult := "StaticText: Iterations=5000, Time="+alltrim(str(nEnd-nStart))+ ;
|
||||
"secs, Average FPS = "+alltrim(str(round(5000 / (nEnd-nStart),0)))+" FPS"
|
||||
@@ -109,7 +113,7 @@ static function WindowBounce()
|
||||
clr[i] := "W+/"+aCol[(i-1)%16+1]
|
||||
next i
|
||||
|
||||
nStart := secondscpu()
|
||||
nStart := hb_secondsCPU()
|
||||
dispbegin()
|
||||
|
||||
do while nFrames < 5000
|
||||
@@ -141,7 +145,7 @@ static function WindowBounce()
|
||||
enddo
|
||||
|
||||
dispend()
|
||||
nEnd := secondscpu()
|
||||
nEnd := hb_secondsCPU()
|
||||
|
||||
cResult := "WindowBounce:Iterations="+alltrim(str(nFrames))+", Time="+alltrim(str(nEnd-nStart))+ ;
|
||||
"secs, Average FPS = "+alltrim(str(round(nFrames / (nEnd-nStart),0)))+" FPS"
|
||||
@@ -163,7 +167,7 @@ static function ColourBoxes()
|
||||
local aCol := {"N", "B", "G", "BG", "R", "RB", "GR", "W", ;
|
||||
"N*","B*","G*","BG*","R*","RB*","GR*","W*" }
|
||||
|
||||
nStart := secondscpu()
|
||||
nStart := hb_secondsCPU()
|
||||
// display boxes to screen
|
||||
|
||||
do while nFrames < 5000
|
||||
@@ -191,7 +195,7 @@ static function ColourBoxes()
|
||||
nDepth--
|
||||
enddo
|
||||
|
||||
nEnd := secondscpu()
|
||||
nEnd := hb_secondsCPU()
|
||||
|
||||
cResult := "ColourBoxes: Iterations="+alltrim(str(nFrames))+", Time="+alltrim(str(nEnd-nStart))+ ;
|
||||
"secs, Average FPS = "+alltrim(str(round(nFrames / (nEnd-nStart),0)))+" FPS"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# [ This should be kept in sync with local Makefile information. ]
|
||||
|
||||
# contribs portable, with no external dependencies:
|
||||
libs=hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmzip hbnf hbtpathy hbziparc rddsql xhb
|
||||
libs=hbbmcdx hbbtree hbclipsm hbct hbfship hbgt hbmisc hbmzip hbnf hbtpathy hbziparc rddsql xhb
|
||||
|
||||
# contribs portable, with external dependencies:
|
||||
libs=hbcurl hbfbird hbgd hbhpdf hbmysql hbpgsql hbqt hbtip sddfb sddmy sddpg
|
||||
|
||||
Reference in New Issue
Block a user