start thinking about vac -- doesn't build yet
This commit is contained in:
parent
7a4ee46d25
commit
7763a61a35
22 changed files with 7959 additions and 0 deletions
47
src/cmd/vac/wtest.c
Normal file
47
src/cmd/vac/wtest.c
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#include "stdinc.h"
|
||||
|
||||
enum {
|
||||
Nblock = 10000,
|
||||
BlockSize = 8*1024,
|
||||
};
|
||||
|
||||
uchar data[Nblock*BlockSize];
|
||||
|
||||
void
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
VtSession *z;
|
||||
int i;
|
||||
uchar score[VtScoreSize];
|
||||
int start;
|
||||
|
||||
ARGBEGIN{
|
||||
}ARGEND
|
||||
|
||||
for(i=0; i<Nblock; i++) {
|
||||
if(readn(0, data+i*BlockSize, BlockSize) < BlockSize)
|
||||
sysfatal("read failed: %r");
|
||||
}
|
||||
|
||||
vtAttach();
|
||||
|
||||
z = vtDial("iolaire2");
|
||||
if(z == nil)
|
||||
sysfatal("cound not connect to venti");
|
||||
if(!vtConnect(z, 0))
|
||||
vtFatal("vtConnect: %s", vtGetError());
|
||||
|
||||
print("starting\n");
|
||||
|
||||
start = times(0);
|
||||
|
||||
for(i=0; i<Nblock; i++) {
|
||||
if(!vtWrite(z, score, VtDataType, data+i*BlockSize, BlockSize))
|
||||
vtFatal("vtWrite failed: %s", vtGetError());
|
||||
}
|
||||
|
||||
print("time = %f\n", (times(0) - start)*0.001);
|
||||
|
||||
vtClose(z);
|
||||
vtDetach();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue