delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/12/15/16:56:16

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16B54384DEEF
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1702677376;
bh=CxSeJmrBtDzxyBS5zqjbW8hOXnxZ9zZuiAMA3jfQKr8=;
h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=C7ScwPM3Kp/o0hPZJjATuIPXXVPwC8l79pyz9X8Vg1lmCuuWMxpBcxFnwrEcnQNpj
3jdVyr5SWYnOFlzGriOBF1Tgje+rZtOO2wM2Tf+dq5f5Uc20j55fd4SUrXe4PeJ6Vu
ex9H9Fe7H0jdWuIi3Nshpm655DD6VXv62y3Pd6p0=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A24E3858C52
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A24E3858C52
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702677340; cv=none;
b=PHTJN2wJCTfYTLwxecPYNlNrU8+rdqZSYJ4jQA9f2OrVuT+7D7RtS3J1CCB8f+Suvog642qNbNFbEyiD2XAh+gbBT4BgiFuTPn7T7Z7hGKoBU4+2p+VpdeMewtGENVTwHC15yW8BVyEVVv7snKlzyYycWQRh2802nLlLpY5xGM0=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1702677340; c=relaxed/simple;
bh=l4jNSCrTM9wCXe4RFIQV9Fkwu8qeVwkHQXgop7kKBVw=;
h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
b=G3KvY9bEwUtL461fgk1KJLe6GMrUwFJ906hV4+wifW7gT2Xv6sjDBTaaEyGZFziLBdlSlwOSfVcD8AGWNY6wRWI5ndSIsPeOg2I+w7kO40heL5966e87uqjOu/wMFaudfggzycYxuYoTLa64+Jmjhm4JxUUviz1+tuVxSD1NZ6U=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1702677337; x=1703282137;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=l4jNSCrTM9wCXe4RFIQV9Fkwu8qeVwkHQXgop7kKBVw=;
b=bOMbTFxTyftTCDfctRnIah3rFf7i/wD+BclBO4wcDIn0oCyVwzw7DDRyPeg+DmAmib
3nVJ5DInR/NI+LY0TcCh9mNyRYJcSfFqPaMEA+3iKoS0LEVPMO7a4bAjm9SA2ubD9M3v
wNaS1iTygDIrwF8Bnb3tDh/J/JiMgZDmgG44GQbRQn6QdG24GSh1Jw6xiN20ZuHK5IpG
9i2qpP534I10GK3oDao1nBM/JL4zSJ4wa6vjE+pkCzbl51a+6FvI9sY5Iwrph7/O2+U9
9uZAF7Ck5V/n21r1AnAd1iGLcUDKcahK6lKqE1lkmRhiGbhhcgSdB3ENQ/LGjW99HLic
leoA==
X-Gm-Message-State: AOJu0Yxy6G6MYmuVkYPzLYEq4OsQT9BPe6Ub0ZYvtKm7lbPCuIqfJhEM
t9Ezld0aU/XfV4oBe+ERk1FnoVj0bUsMpYNqJpXX3zAvMyo=
X-Google-Smtp-Source: AGHT+IE1IC6KxFzEW2gIj+WmGdHBidmlkSBdldarvDCyn7g14oztKPH10VJw+H3WYIGu7Aj8TGSyiOEEnTnRdUKHBlQ=
X-Received: by 2002:aa7:88c8:0:b0:6c6:b5ae:15a4 with SMTP id
k8-20020aa788c8000000b006c6b5ae15a4mr13351122pff.20.1702677337595; Fri, 15
Dec 2023 13:55:37 -0800 (PST)
MIME-Version: 1.0
Date: Fri, 15 Dec 2023 13:55:26 -0800
Message-ID: <CAKwdsS-eM0APxDhbFNq6SBVKK51hteMgKrwmzm-ZNNEUnaON=A@mail.gmail.com>
Subject: How efficient is 'sleep'?
To: cygwin AT cygwin DOT com
X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Backwoods BC via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Backwoods BC <completely DOT and DOT totally DOT trash AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

I have quite a few "service-like" scripts that I put into the
background and then have them wake up on a regular basis to do
something. I use 'sleep' for the timing of the wakeup periods.

My question is: How efficient is 'sleep'? I know of other OSes that
just set a timer flag and the process isn't allocated any CPU time
until the timer expires.

I know that creating a service or even using Task Scheduler are more
"proper" ways of doing this, but they are also much more work and
would require a significant learning curve as my background is
embedded systems, not Windows. I know that my lazy way probably has a
penalty, but just how bad is it?

Thanks

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019