ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/main.C
(Generate patch)

Comparing deliantra/server/server/main.C (file contents):
Revision 1.86 by root, Thu Jan 18 16:19:34 2007 UTC vs.
Revision 1.87 by root, Thu Jan 18 19:32:37 2007 UTC

589 attachable::check_mortals (); 589 attachable::check_mortals ();
590 590
591 ++pticks; 591 ++pticks;
592} 592}
593 593
594#if 0
595// used fro benchmarking (x86/amd64-specific)
596typedef unsigned long tval;
597typedef unsigned long long stamp64;
598
599extern inline tval
600stamp (void)
601{
602 tval tsc;
603 asm volatile ("rdtsc":"=a" (tsc)::"edx");
604
605 return tsc;
606}
607
608extern inline tval
609measure (tval t)
610{
611 tval tsc;
612 asm volatile ("rdtsc":"=a" (tsc)::"edx");
613
614 if (tsc > t)
615 return tsc - t;
616 else
617 return t - tsc;
618}
619
594int 620int
595main (int argc, char **argv) 621main (int argc, char **argv)
596{ 622{
623 rand_gen rg(0);
624 tval fastest = 0x7fffffff;
625 for (int loop = 10000; loop--; )
626 {
627 tval s = stamp ();
628 volatile int i = rg.get_int(25);
629 fastest = min (fastest, measure (s));
630 }
631
632 //printf ("fastest %d\n", fastest);
633 for (int i = 0; i < 1024*1024*3; ++i)
634 {
635 char c = rg.get_int (256);
636 write (2, &c, 1);
637 }
638}
639
640#else
641
642// normal main
643int
644main (int argc, char **argv)
645{
597 settings.argc = argc; 646 settings.argc = argc;
598 settings.argv = argv; 647 settings.argv = argv;
599 648
600 init (argc, argv); 649 init (argc, argv);
601 650
602 initPlugins (); 651 initPlugins ();
603 652
604 for (;;) 653 for (;;)
605 cfperl_main (); 654 cfperl_main ();
606} 655}
656#endif
607 657

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines