From patchwork Mon Mar 2 09:43:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 5910991 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4E0F79F749 for ; Mon, 2 Mar 2015 09:43:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 661642020E for ; Mon, 2 Mar 2015 09:43:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DCA020212 for ; Mon, 2 Mar 2015 09:43:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751670AbbCBJnh (ORCPT ); Mon, 2 Mar 2015 04:43:37 -0500 Received: from mail.bmw-carit.de ([62.245.222.98]:53490 "EHLO linuxmail.bmw-carit.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751098AbbCBJnf (ORCPT ); Mon, 2 Mar 2015 04:43:35 -0500 Received: from localhost (handman.bmw-carit.intra [192.168.101.60]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: daniel.wagner) by linuxmail.bmw-carit.de (Postfix) with ESMTPSA id 94A6D400B2; Mon, 2 Mar 2015 08:39:10 +0100 (CET) From: Daniel Wagner To: Jeff Layton Cc: linux-fsdevel@vger.kernel.org, Daniel Wagner Subject: [PATCH v0 1/2] Print leading zeros after decimal point Date: Mon, 2 Mar 2015 10:43:24 +0100 Message-Id: <1425289405-13365-2-git-send-email-daniel.wagner@bmw-carit.de> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1425289405-13365-1-git-send-email-daniel.wagner@bmw-carit.de> References: <1425289405-13365-1-git-send-email-daniel.wagner@bmw-carit.de> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The total time used for a test is a bit 'hard to read, because leading zeros for the nsec part are missing, e.g. total.tv_sec = 1 total.tv_nsec = 40013 results in 1.40013 instead of 1.000040013 Signed-off-by: Daniel Wagner --- flock01.c | 2 +- flock02.c | 2 +- lease01.c | 2 +- lease02.c | 2 +- posix01.c | 2 +- posix02.c | 2 +- posix03.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flock01.c b/flock01.c index f74e031..f5416f6 100644 --- a/flock01.c +++ b/flock01.c @@ -154,6 +154,6 @@ main(int argc, char **argv) return 1; } - printf("%ld.%ld\n", total.tv_sec, total.tv_nsec); + printf("%ld.%09ld\n", total.tv_sec, total.tv_nsec); return 0; } diff --git a/flock02.c b/flock02.c index 9e795ac..81c770a 100644 --- a/flock02.c +++ b/flock02.c @@ -173,6 +173,6 @@ main(int argc, char **argv) return 1; } - printf("%ld.%ld\n", total.tv_sec, total.tv_nsec); + printf("%ld.%09ld\n", total.tv_sec, total.tv_nsec); return 0; } diff --git a/lease01.c b/lease01.c index f3a2ae9..0771974 100644 --- a/lease01.c +++ b/lease01.c @@ -171,7 +171,7 @@ main(int argc, char **argv) return 1; } - printf("%ld.%ld\n", total.tv_sec, total.tv_nsec); + printf("%ld.%09ld\n", total.tv_sec, total.tv_nsec); return 0; } diff --git a/lease02.c b/lease02.c index 0fa33e4..6450e16 100644 --- a/lease02.c +++ b/lease02.c @@ -173,6 +173,6 @@ main(int argc, char **argv) return 1; } - printf("%ld.%ld\n", total.tv_sec, total.tv_nsec); + printf("%ld.%09ld\n", total.tv_sec, total.tv_nsec); return 0; } diff --git a/posix01.c b/posix01.c index 1dd853d..09f1de6 100644 --- a/posix01.c +++ b/posix01.c @@ -174,6 +174,6 @@ main(int argc, char **argv) return 1; } - printf("%ld.%ld\n", total.tv_sec, total.tv_nsec); + printf("%ld.%09ld\n", total.tv_sec, total.tv_nsec); return 0; } diff --git a/posix02.c b/posix02.c index 8764db1..9a35c99 100644 --- a/posix02.c +++ b/posix02.c @@ -175,6 +175,6 @@ main(int argc, char **argv) return 1; } - printf("%ld.%ld\n", total.tv_sec, total.tv_nsec); + printf("%ld.%09ld\n", total.tv_sec, total.tv_nsec); return 0; } diff --git a/posix03.c b/posix03.c index 291f21a..864f0f0 100644 --- a/posix03.c +++ b/posix03.c @@ -206,7 +206,7 @@ int main(int argc, char *argv[]) total = timespec_add(total, timespec_sub(end, start)); } - printf("%ld.%ld\n", total.tv_sec, total.tv_nsec); + printf("%ld.%09ld\n", total.tv_sec, total.tv_nsec); kill_children(); return 0; }