Date: Thu, 14 Jan 2016 01:23:15 +1100 (EST) From: Ian Smith <smithi@nimnet.asn.au> To: "darwinsurvivor@gmail.com" <darwinsurvivor@gmail.com> Cc: kpneal@pobox.com, "William A. Mahaffey III" <wam@hiwaay.net>, freebsd-questions@freebsd.org Subject: Re: Task to busy one CPU 100% for a period of time? Message-ID: <20160114010606.X93547@sola.nimnet.asn.au> In-Reply-To: <20160114000637.U93547@sola.nimnet.asn.au> References: <20160111002439.Q93547@sola.nimnet.asn.au> <56928802.2040802@hiwaay.net> <20160111154616.G93547@sola.nimnet.asn.au> <20160111203832.GC88498@neutralgood.org> <20160113052558.R93547@sola.nimnet.asn.au> <CAMuYtRDoKfGC0awAon1%2BBmUKsj6ugau-umgzCiR8MpbA37QTgQ@mail.gmail.com> <20160114000637.U93547@sola.nimnet.asn.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 14 Jan 2016 00:57:58 +1100, Ian Smith wrote: > echo "`date` $me running $tasks load1 tasks for ${secs}s" > bgpids='' > done=0; trap "done=1; sleep=0" int quit term Oops, s/sleep/secs/ .. only added for extremely unlikely case one might hit ^C during starting up the load1 task/s, so untested. > while [ $done -eq 0 ]; do > while [ $tasks -gt 0 ]; do > ~/bin/load1 & > bgpids="$bgpids $!" > tasks=$((tasks-1)) > done > sleep $secs > done=1 > done And a missed tab .. too darn hot tonight :) cheers, Ian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160114010606.X93547>