Make the action completion watchdog wait instead of waiting for the first
possible action completion to reduce contention. This isn't very pretty, but I
think should be good enough.

RELNOTES: None.
PiperOrigin-RevId: 209111759
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionInactivityWatchdog.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionInactivityWatchdog.java
index 94e12fb..35446dc 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionInactivityWatchdog.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionInactivityWatchdog.java
@@ -45,7 +45,7 @@
      *
      * @return the number of actions completed during the wait
      */
-    int waitForNextCompletion(int timeoutMilliseconds) throws InterruptedException;
+    int waitForNextCompletion(int timeoutSeconds) throws InterruptedException;
   }
 
   /** An object that the watchdog can report inactivity to. */
@@ -145,7 +145,7 @@
         // Wait a while for any SkyFunction to finish. The returned number indicates how many
         // actions completed during the wait. It's possible that this is more than 1, since
         // this thread may not immediately regain control.
-        int completedActions = monitor.waitForNextCompletion(waitTime.next() * 1000);
+        int completedActions = monitor.waitForNextCompletion(waitTime.next());
         if (!isRunning.get()) {
           break;
         }