From patchwork Tue Feb 22 12:51:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 5260 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4K2zbQ3m4xz3xgh for ; Tue, 22 Feb 2022 12:52:34 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4K2zZt73QTz5bG; Tue, 22 Feb 2022 12:52:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4K2zZt62H1z32MP; Tue, 22 Feb 2022 12:52:06 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4K2zZj1XT6z32Mn for ; Tue, 22 Feb 2022 12:51:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4K2zZh5WG2z5SZ; Tue, 22 Feb 2022 12:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1645534316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xyvg9AErGpjVBNS7eZGcNWhJIRfBdzoRrrqx/sDGI70=; b=jvkBk6lzh4jG423sirbxXUhZWTpQbHlvXgm77Ic4iJbAUhAv5Ao8lOOVq3ALbBIzr+0Ko3 imbqV58msrWwBtAoAcPWMbQey4MD2yV3u/8m93H/fABZib5AwfRTFjF3PXPBM2VEyQii/b avZmdEuRKE85OgQtxGokECR2XNIr+uVH4PByxk1EIBb1755kXrrwcuomTFEeBTEoOAGOoi Eu/MNtRGcw02c3QgsH/7iFSilExKqmtQl8dbDdCN5r/F0KbyvGaj/AAjsnYmhNEniFZsw2 8wjk7EIwPP9vDeI/qoszR3FQFULvYr/RdybyObKrXHp72vVULIK0LqeDBRdglw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1645534316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xyvg9AErGpjVBNS7eZGcNWhJIRfBdzoRrrqx/sDGI70=; b=FXNdA17VlibD7kjskuVAMRoYq4fogozZYsekfBd6VXpJAjoPTorjlwwZW9uS9prKtz4ugd qUbpYBjfVeDNuABQ== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 38/50] make.sh: Avoid calling date when determining elapsed seconds Date: Tue, 22 Feb 2022 12:51:23 +0000 Message-Id: <20220222125135.1211290-39-michael.tremer@ipfire.org> In-Reply-To: <20220222125135.1211290-1-michael.tremer@ipfire.org> References: <20220222125135.1211290-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- make.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/make.sh b/make.sh index ed8cd260e..cb11b36ab 100755 --- a/make.sh +++ b/make.sh @@ -295,10 +295,6 @@ stdumount() { umount $BASEDIR/build/tmp 2>/dev/null; } -now() { - date -u "+%s" -} - format_runtime() { local seconds=${1} @@ -741,7 +737,7 @@ ipfiredist() { wait_until_finished() { local pid=${1} - local start_time=$(now) + local start_time="${SECONDS}" # Show progress if ${INTERACTIVE}; then @@ -751,7 +747,7 @@ wait_until_finished() { local runtime while kill -0 ${pid} 2>/dev/null; do - print_runtime $(( $(now) - ${start_time} )) + print_runtime $(( SECONDS - start_time )) # Wait a little sleep 1 @@ -763,7 +759,7 @@ wait_until_finished() { local ret=$? if ! ${INTERACTIVE}; then - print_runtime $(( $(now) - ${start_time} )) + print_runtime $(( SECONDS - start_time )) fi return ${ret} @@ -1831,7 +1827,7 @@ done # See what we're supposed to do case "$1" in build) - START_TIME=$(now) + START_TIME="${SECONDS}" # Clear screen ${INTERACTIVE} && clear @@ -1876,7 +1872,7 @@ build) tools/checkrootfiles cd $PWD - print_build_summary $(( $(now) - ${START_TIME} )) + print_build_summary $(( SECONDS - START_TIME )) ;; shell) # enter a shell inside LFS chroot