MCPcopy Create free account
hub / github.com/Kitware/CMake / kwsysProcessGetTimeoutLeft

Function kwsysProcessGetTimeoutLeft

Source/kwsys/ProcessWin32.c:1988–2013  ·  view source on GitHub ↗

Get the length of time before the given timeout time arrives. Returns 1 if the time has already arrived, and 0 otherwise. */

Source from the content-addressed store, hash-verified

1986/* Get the length of time before the given timeout time arrives.
1987 Returns 1 if the time has already arrived, and 0 otherwise. */
1988int kwsysProcessGetTimeoutLeft(kwsysProcessTime* timeoutTime,
1989 double* userTimeout,
1990 kwsysProcessTime* timeoutLength)
1991{
1992 if (timeoutTime->QuadPart < 0) {
1993 /* No timeout time has been requested. */
1994 return 0;
1995 } else {
1996 /* Calculate the remaining time. */
1997 kwsysProcessTime currentTime = kwsysProcessTimeGetCurrent();
1998 *timeoutLength = kwsysProcessTimeSubtract(*timeoutTime, currentTime);
1999
2000 if (timeoutLength->QuadPart < 0 && userTimeout && *userTimeout <= 0) {
2001 /* Caller has explicitly requested a zero timeout. */
2002 timeoutLength->QuadPart = 0;
2003 }
2004
2005 if (timeoutLength->QuadPart < 0) {
2006 /* Timeout has already expired. */
2007 return 1;
2008 } else {
2009 /* There is some time left. */
2010 return 0;
2011 }
2012 }
2013}
2014
2015kwsysProcessTime kwsysProcessTimeGetCurrent()
2016{

Callers 1

kwsysProcess_WaitForDataFunction · 0.70

Calls 2

kwsysProcessTimeSubtractFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…