home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 28
/
amigaformatcd28.iso
/
-seriously_amiga-
/
misc
/
posbb
/
src
/
amigaos
/
posbb_tests.doc
< prev
next >
Wrap
Text File
|
1998-05-09
|
10KB
|
344 lines
ATTENTION SOME OF THIS DATA COULD BE WRONG
I'LL UPDATE THIS DOC SOON,BUT AT THIS TIME IT COULD BE OUTDATED
TABLE OF CONTENTS
posbb_tests.c/--background--
posbb_tests.c/Test_CopyMem
posbb_tests.c/Test_Draw
posbb_tests.c/Test_DrawEllipse
posbb_tests.c/Test_FPMath
posbb_tests.c/Test_IMath
posbb_tests.c/Test_printf
posbb_tests.c/Test_Read
posbb_tests.c/Test_Write
posbb_tests.c/Test_WritePixel
posbb_tests.c/--background-- posbb_tests.c/--background--
These are the functions wich really do tests. All them returns
the time taken in clocks (it uses the C function clock()).
To have the time in seconds divide the time in clocks per CLOCKS_PER_SEC
.
seconds = clocks / CLOCKS_PER_SEC
posbb_tests.c/Test_CopyMem posbb_tests.c/Test_CopyMem
NAME
Test_CopyMem -- Tests speed of exec.library/CopyMem().
SYNOPSIS
time = Test_CopyMem( int precision )
int Test_CopyMem( int );
FUNCTION
Does 100,000 CopyMem() of a 1024 bytes memory block and returns the
time it has spent.
INPUT
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - Time spent,in seconds.
TRUE if something went wrong (usually lack of memory).
EXAMPLE
Examine posbb.c/Perform_Tests().
BUGS
It has no known bugs,but it use Forbid() and Permit(),
also if Amiga Technologies has told not to use them for future
compatibility.If the AmigaOS will really ported to PowerPC processor
and this will not work,I'll fix it.
posbb_tests.c/Test_Draw posbb_tests.c/Test_Draw
NAME
Test_Draw -- Tests pixel ellipse drawing speed.
SYNOPSIS
time = Test_Draw(struct RastPort *rport,int precision)
int Test_Draw( struct RastPort,int );
FUNCTION
Draws some lines in the given rastport and returns the time taken.
INPUT
struct RastPort *rport Pointer to a valid RastPort structure to draw on
.
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - Time spent,in seconds.
EXAMPLE
See posbb.c/Perform_Tests.
BUGS
No known bugs.
posbb_tests.c/Test_DrawEllipse posbb_tests.c/Test_DrawEllipse
NAME
Test_DrawEllipse -- Tests pixel ellipse drawing speed.
SYNOPSIS
time = Test_DrawEllipse(struct RastPort *rport,int precision)
int Test_DrawEllipse( struct RastPort,int );
FUNCTION
Draws some ellipses in the given rastport and returns the time taken.
INPUT
struct RastPort *rport pointer to a valid RastPort structure
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - Time spent in seconds. No error can be returned.
EXAMPLE
See posbb.c/Perform_Tests.
BUGS
No known bugs.
posbb_tests.c/Test_FPMath posbb_tests.c/Test_FPMath
NAME
Test_FPMath -- Tests the speed of some floating point Math operations.
SYNOPSIS
time = Test_FPMath( int precision )
int Test_FPMath( int );
FUNCTION
Does 1 million of additions,differences,multiplications and divisions
and returns the time it took.
INPUT
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - Time spent in seconds. At the moment no error can be returned.
EXAMPLE
See posbb.c/Perform_Tests()
NOTES
To obtain code for FPU use the right option of your compiler.
BUGS
Like some other functions it uses Forbid()/Permit(),wich probably will
not work under a future Amiga OS.
Until now it doesn't check if memory allocations needed for variuos
tables used in the test has failed. In that case it will probably
crash. I'll fix it in new versions.
posbb_tests.c/Test_IMath posbb_tests.c/Test_IMath
NAME
Test_IMath -- Tests the speed of some int Math operations.
SYNOPSIS
time = Test_IMath( int precision )
int Test_IMath( int );
FUNCTION
Does 1 million of additions,differences,multiplications and divisions
and returns the time it took.
INPUT
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - Time spent in seconds. No error can be returned.
EXAMPLE
See posbb.c/Perform_Tests()
BUGS
Like some other function it uses Forbid()/Permit(),wich probably will
not work under a future Amiga OS.
It doesn't check if memory allocations fail. In that case it will
probably crash. I'll fix it in future versions.
posbb_tests.c/Test_printf posbb_tests.c/Test_printf
NAME
Test_printf -- Tests the speed of the ANSI function printf().
SYNOPSIS
time = Test_printf( int precision )
int Test_printf( int );
FUNCTION
Writes 1,000 times the string "printf test in progress...\n" to stdout
and returns the time taken.
INPUT
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - number of seconds spent.
EXAMPLE
See posbb.c/Perform_Tests().
NOTE
In future versions it will return a float.
BUGS
It hasn't bugs,but since it can't turn off multitasking,the result
could change if the user runs some program or move windows.
posbb_tests.c/Test_Read posbb_tests.c/Test_Read
NAME
Test_Read -- Tests disk reading speed.
SYNOPSIS
time = Test_Read( STRPTR filename,int precision )
int Test_Read( STRPTR, int );
FUNCTION
Reades a block of data from a file,with dos.library/Read() (in the
Amiga version).
INPUT
STRPTR filename the name of the file to read from
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - Time spent in seconds.
Returns TRUE if something went wrong ( memory or disk space
usually). In future may return differents error codes.
EXAMPLE
See posbb.c/Perform_Tests.
NOTES
In future versions it will use different functions depending on dos.libr
ary version.
With dos.library V 36+ it will use buffered routines,unbuffered on previ
ous versions.
The results given by Test_Read() and Test_Write() depend not only on the
disk/filesystem
speed, but also on disk fragmentation. For a more reliable test of your
HD use
other programs.
.
BUGS
No known bugs.
posbb_tests.c/Test_Write posbb_tests.c/Test_Write
NAME
Test_Write -- Tests disk writing speed.
SYNOPSIS
time = Test_Write( STRPTR filename,int precision )
double Test_Write( STRPTR ,int );
FUNCTION
Writes a block of data to a file,with dos.library/Write() (in the Amiga
version).
INPUT
STRPTR filename the name of the file to write to.
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - Time spent ins econds.
Returns TRUE if something went wrong ( memory or disk space usual
ly).
In future may return differents error codes.
EXAMPLE
See posbb.c/Perform_Tests.
BUGS
No known bugs.
posbb_tests.c/Test_WritePixel posbb_tests.c/Test_WritePixel
NAME
Test_WritePixel -- Tests pixel writing speed.
SYNOPSIS
time = Test_WritePixel(struct RastPort *rport,int precision)
int Test_WritePixel( struct RastPort,int );
FUNCTION
Fill the given rastport pixel by pixel with graphics.library/WritePixel(
)
and returns the time taken.
INPUT
*rport pointer to a valid RastPort structure to draw on.
int precision the precision of the results. Can be any of
POSBB_PREECISION#?. The higher is the precision wanted
,
the higher the time taken. precision is useful on fast
er
machines,on wich the times will be too low.
RESULT
time - Time spent in seconds. No errors can be returned.
EXAMPLE
See posbb.c/Perform_Tests.
BUGS
No known bugs.