Commits

Sebastian Bub  committed 571d637

timing for reading in readTimeBasedAnalogIn

  • Participants
  • Parent commits 740af2f

Comments (0)

Files changed (2)

File log4j.properties

 log4j.appender.A1.MaxBackupIndex=5
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 log4j.appender.A1.layout.ConversionPattern=[%d{dd.MM.yyyy HH:mm:ss}] %p %c - %m%n
+######### %l gives more info, but is time consuming
+#log4j.appender.A1.layout.ConversionPattern=[%d{dd.MM.yyyy HH:mm:ss}] %p %c - %l - %m%n
 

File src/main/java/de/derbub/rpigpio/gpio/GpioSysFsInterface.java

                     bf = new BufferedReader(aGpioFileReader);
                     long before = System.currentTimeMillis();
                     do {
-                        currentState =  bf.readLine();
+                        currentState = bf.readLine();
                         counter++;
                     } while (defaultState.equals(currentState));
-                    log.info("Setting value to " + counter + " for " + gpio + (FileHandlingFactory.isSimulation() ? " (SIMULATION)" : ""));
+                    log.info("Setting value to " + counter + " (within " + (System.currentTimeMillis() - before) + "ms) for "
+                        + gpio + (FileHandlingFactory.isSimulation() ? " (SIMULATION)" : ""));
                 } else {
                     log.error("File " + aGpioFile + " does not exist. Check previous errors.");
                 }