834bc1e30d
Files correlati : Ricompilazione Demo : [ ] Commento : Correzzione relaitive al riporto precedente git-svn-id: svn://10.65.10.50/trunk@9672 c028cbd2-c16b-5b4b-a496-9718f37d4682
59 lines
1.3 KiB
C++
Executable File
59 lines
1.3 KiB
C++
Executable File
#include <applicat.h>
|
|
#include <isam.h>
|
|
#include <progind.h>
|
|
#include <urldefid.h>
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// Testfil
|
|
///////////////////////////////////////////////////////////
|
|
|
|
class TTest_application : public TSkeleton_application
|
|
{
|
|
|
|
protected:
|
|
bool create() { dispatch_e_menu(BAR_ITEM(1)); return TSkeleton_application::create(); }
|
|
bool destroy() { return TRUE; }
|
|
virtual void main_loop();
|
|
|
|
public:
|
|
TTest_application() {}
|
|
};
|
|
|
|
void TTest_application::main_loop()
|
|
{
|
|
TLocalisamfile tab(LF_COMUNI);
|
|
const TRecnotype n = tab.items();
|
|
|
|
clock_t start;
|
|
TRecnotype r = 1;
|
|
TString80 msg;
|
|
{
|
|
TProgind p(n, "Lettura file comuni", TRUE, TRUE, 32);
|
|
start = clock();
|
|
for (tab.first(); tab.good(); tab.next(), r++)
|
|
{
|
|
if ((r % 100) == 0)
|
|
{
|
|
msg.format("%ld records %ld msec", r, clock() - start);
|
|
p.setstatus(r);
|
|
p.set_text(msg);
|
|
if (p.iscancelled()) break;
|
|
}
|
|
}
|
|
}
|
|
const clock_t t = clock() - start;
|
|
msg.format("%ld records in %ld msec\n%lg records per sec", r, t, 1000.0*r/t);
|
|
message_box(msg);
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
int ba1200(int argc, char** argv)
|
|
{
|
|
TTest_application a;
|
|
a.run(argc, argv, "Test File");
|
|
return 0;
|
|
}
|
|
|