X-Git-Url: http://git.mutantstargoat.com?p=eqemu;a=blobdiff_plain;f=src%2Fdev.cc;h=44a263a5ac4c8d71a2eafb9f91b3224a1a94155f;hp=463be30f390d662e3b64638d7e5aef1b5ce3aa91;hb=HEAD;hpb=0e2e8209f950a0a99bc08a0a6cc6896d304a7958
diff --git a/src/dev.cc b/src/dev.cc
index 463be30..44a263a 100644
--- a/src/dev.cc
+++ b/src/dev.cc
@@ -20,7 +20,9 @@ along with this program. If not, see .
#include
#include
#include
+#include
#include
+#include
#include
#include
#include
@@ -30,12 +32,22 @@ along with this program. If not, see .
#include "dev.h"
#include "timer.h"
+struct CustStat {
+ int id;
+ time_t start, end;
+};
+
+#define TMHIST_SIZE 16
+
void post_redisplay(); // defined in main.cc
int customer, ticket;
static int report_inputs, cmd_echo;
static long last_ticket_msec = LONG_MIN;
+static std::vector cstat;
+
+time_t calc_avg_wait();
static void runcmd(const char *cmd);
static int fd = -1;
@@ -123,6 +135,14 @@ void issue_ticket()
{
ticket++;
last_ticket_msec = get_msec();
+
+ CustStat st;
+ st.id = ticket;
+ st.start = time(0);
+ st.end = (time_t)-1;
+ cstat.push_back(st);
+
+
if(report_inputs) {
fprintf(fp, "ticket: %d\n", ticket);
}
@@ -135,6 +155,16 @@ void next_customer()
if(customer < ticket) {
customer++;
last_ticket_msec = LONG_MIN;
+
+ for(size_t i=0; i