+void GameCommand_animbench(float request, float argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ entity tmp_entity;
+
+ if(argc >= 4)
+ {
+ tmp_entity = spawn();
+ if(argv(1) == "w")
+ setmodel(tmp_entity, (nextent(world)).weaponentity.model);
+ else
+ {
+ precache_model(argv(1));
+ setmodel(tmp_entity, argv(1));
+ }
+ float f1 = stof(argv(2));
+ float f2 = stof(argv(3));
+ float t0;
+ float t1 = 0;
+ float t2 = 0;
+ float n = 0;
+
+ while(t1 + t2 < 1)
+ {
+ tmp_entity.frame = f1;
+ t0 = gettime(GETTIME_HIRES);
+ getsurfacepoint(tmp_entity, 0, 0);
+ t1 += gettime(GETTIME_HIRES) - t0;
+ tmp_entity.frame = f2;
+ t0 = gettime(GETTIME_HIRES);
+ getsurfacepoint(tmp_entity, 0, 0);
+ t2 += gettime(GETTIME_HIRES) - t0;
+ n += 1;
+ }
+ print("model ", tmp_entity.model, " frame ", ftos(f1), " animtime ", ftos(n / t1), "/s\n");
+ print("model ", tmp_entity.model, " frame ", ftos(f2), " animtime ", ftos(n / t2), "/s\n");
+
+ remove(tmp_entity);
+ return;
+ }
+ }
+
+ default:
+ print("Incorrect parameters for ^2gettaginfo^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ print("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
+ print("See also: ^2bbox, trace^7\n");
+ return;
+ }
+ }
+}
+