From 1e0f730dc8263e1b068a02534155b39eb1b42feb Mon Sep 17 00:00:00 2001
From: c vw <dl1ycf@darc.de>
Date: Mon, 15 Jun 2020 16:50:41 +0200
Subject: [PATCH] removed the debug timing code

---
 rigctl.c | 53 -----------------------------------------------------
 1 file changed, 53 deletions(-)

diff --git a/rigctl.c b/rigctl.c
index f00c387..2da29d0 100644
--- a/rigctl.c
+++ b/rigctl.c
@@ -58,13 +58,6 @@
 #endif
 #include <math.h>
 
-#define RIGCTL_TIMING
-#ifdef RIGCTL_TIMING
-#ifdef __APPLE__
-#include "MacOS.h"  // emulate clock_gettime on old MacOS systems
-#endif
-#endif
-
 #define NEW_PARSER
 
 // IP stuff below
@@ -136,9 +129,6 @@ typedef struct _client {
 typedef struct _command {
   CLIENT *client;
   char *command;
-#ifdef RIGCTL_TIMING
-  struct timespec *rcvd;  // exact time when this command has been received
-#endif
 } COMMAND;
 
 static CLIENT client[MAX_CLIENTS];
@@ -690,10 +680,6 @@ static gpointer rigctl_client (gpointer data) {
            COMMAND *info=g_new(COMMAND,1);
            info->client=client;
            info->command=command;
-#ifdef RIGCTL_TIMING
-           info->rcvd=g_new(struct timespec, 1);
-           clock_gettime(CLOCK_MONOTONIC, info->rcvd);
-#endif
            g_idle_add(parse_cmd,info);
            command=g_new(char,MAXDATASIZE);
            command_index=0;
@@ -2590,31 +2576,12 @@ gboolean parse_extended_cmd (char *command,CLIENT *client) {
 int parse_cmd(void *data) {
   COMMAND *info=(COMMAND *)data;
   CLIENT *client=info->client;
-#ifdef RIGCTL_TIMING
-  struct timespec *ts=info->rcvd;
-#endif
   char *command=info->command;
   char reply[80];
   reply[0]='\0';
   gboolean implemented=TRUE;
   gboolean errord=FALSE;
-  struct timespec now;
 
-#ifdef RIGCTL_TIMING
-  if (rigctl_debug) {
-    //
-    // Time (in msec) after reception of the command
-    //
-    long diff; // diff in msec
-    clock_gettime(CLOCK_MONOTONIC, &now);
-    now.tv_sec  -= ts->tv_sec;
-    now.tv_nsec -= ts->tv_nsec;
-    diff = 1000*now.tv_sec + (now.tv_nsec / 1000000);
-    g_print("RIGCTL: parse start TIME=%ld fd=%d COMMAND=%s\n", diff, client->fd, command);
-  }
-#else
-    g_print("RIGCTL: fd=%d COMMAND=%s\n", client->fd, command);
-#endif
   switch(command[0]) {
     case 'A':
       switch(command[1]) {
@@ -3886,23 +3853,7 @@ int parse_cmd(void *data) {
     send_resp(client->fd,"?;");
   }
 
-#ifdef RIGCTL_TIMING
-  if (rigctl_debug) {
-    //
-    // Time (in msec) after reception of the command
-    //
-    long diff; // diff in msec
-    clock_gettime(CLOCK_MONOTONIC, &now);
-    now.tv_sec  -= ts->tv_sec;
-    now.tv_nsec -= ts->tv_nsec;
-    diff = 1000*now.tv_sec + (now.tv_nsec / 1000000);
-    g_print("RIGCTL: parse end  : TIME=%ld fd=%d COMMAND=%s\n", diff, client->fd, command);
-  }
-#endif
   g_free(info->command);
-#ifdef RIGCTL_TIMING
-  g_free(info->rcvd);
-#endif
   g_free(info);
   return 0;
 }
@@ -3992,10 +3943,6 @@ static gpointer serial_server(gpointer data) {
              COMMAND *info=g_new(COMMAND,1);
              info->client=client;
              info->command=command;
-#ifdef RIGCTL_TIMING
-	     info->rcvd=g_new(struct timespec, 1);
-             clock_gettime(CLOCK_MONOTONIC, info->rcvd);
-#endif
              g_mutex_lock(&mutex_busy->m);
              g_idle_add(parse_cmd,info);
              g_mutex_unlock(&mutex_busy->m);
-- 
2.45.2