X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B644384CBA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1702679317; bh=7HRHu9vy8V35TCYQ4zDe8E4KY97FsFEIOHUdDR0OoO4=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=CzH06XTTJEa4P2Pmgt33m/KcSqYeEfJpxu+z8hVlZE7votfWokj5q2CYT1tB2GQQu /lvAA65nvL2sBjVI+usv8MqiUWIinTa4C+Mtd9doGbFI8XIOEcMB21IzgHxUd3RRh/ mwZD/OVYArHU4sT2z8AilGt1E0kQQgdpKihnJXGM= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1FE53858C52 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D1FE53858C52 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702679282; cv=none; b=a7tBfRed08D0Yj3WuTfoPEpFx40s3s4sh9Sl68XXOVHPB1AiW6/gU4m/OgIb13y4Fl1JPJySbkHXtH435a6elKnBApGV1vH0JSbQfwJb0FWxm8v43SX65+tmUZd4PI2y+8NrMgFJGrF7vwL1QXu29kmcgvyxb9wcloyLPElso/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702679282; c=relaxed/simple; bh=SC33Jo+Zj0IP+YxvKtHjbNEASjUu6QrIBNVg0Dy2SI4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=X4ipZE8Cljbq7Mswu2VxHPefpDupy3F30MDxJHYV6CJlD48Div9EmTW4e5fNlGGLyeoKU6fgtODWI6V2Ea80IoTCezkr8wVfFtEs8iA/ADkvVDsOlnarso/25YsJ86v/0kiMjpholWiiYfo9fYtZpeadiFKtl5H1xq10JVIFhd0= ARC-Authentication-Results: i=1; server2.sourceware.org X-Authority-Analysis: v=2.4 cv=MPFzJeVl c=1 sm=1 tr=0 ts=657cd2f0 a=DxHlV3/gbUaP7LOF0QAmaA==:117 a=DxHlV3/gbUaP7LOF0QAmaA==:17 a=IkcTkHD0fZMA:10 a=NEAV23lmAAAA:8 a=7392p9bmP1SmsWvOWsUA:9 a=QEXdDO2ut3YA:10 Message-ID: <1346459b-b3b2-4bac-878d-11996e3970ef@Shaw.ca> Date: Fri, 15 Dec 2023 15:27:59 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How efficient is 'sleep'? Content-Language: en-CA To: cygwin AT cygwin DOT com References: Organization: Inglis In-Reply-To: X-CMAE-Envelope: MS4xfMFaBcNZTl6Mt8T2Vg/P1aG6FAUQrdSzrtgaTSZR9seOSzVDVX6lsj5R0I4I1NIJ55w3c4a5+mcQXebOsAe5HliHXuQ4rqKeIT8DdfE1xmEMg2vT5YZp L3PXsLl7f7UZeDox9IKGaDOwiqn0jcMrrfpNLuip34JF3XPpo6VCSN7ZxmUAvo+zpKIeFnh158wEtQ== X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Brian Inglis via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Brian Inglis Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 3BFMSc59002490 On 2023-12-15 14:55, Backwoods BC via Cygwin wrote: > 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? Install Cygwin packages cron plus cygrunsrv to run daemons as services. Setup cron service by running /usr/sbin/cron-config as elevated admin. Then use crontab to schedule scripts every so often or at specific times or days. Install package and read man pages or see the current package repo: https://github.com/vixie/cron/blob/master/crontab.5 -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry -- 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