diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/tools/build/example/time | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/tools/build/example/time')
-rw-r--r-- | src/boost/tools/build/example/time/hello.cpp | 16 | ||||
-rw-r--r-- | src/boost/tools/build/example/time/jamroot.jam | 16 | ||||
-rw-r--r-- | src/boost/tools/build/example/time/readme.qbk | 47 |
3 files changed, 79 insertions, 0 deletions
diff --git a/src/boost/tools/build/example/time/hello.cpp b/src/boost/tools/build/example/time/hello.cpp new file mode 100644 index 00000000..68080228 --- /dev/null +++ b/src/boost/tools/build/example/time/hello.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2003 Vladimir Prus +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// http://www.boost.org +// + +#include <iostream> + +int main() +{ + std::cout << "Hello!\n"; + return 1; +} diff --git a/src/boost/tools/build/example/time/jamroot.jam b/src/boost/tools/build/example/time/jamroot.jam new file mode 100644 index 00000000..3e2730f8 --- /dev/null +++ b/src/boost/tools/build/example/time/jamroot.jam @@ -0,0 +1,16 @@ +#| +Distributed under the Boost Software License, Version 1.0. (See +accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +|# + +#[jamroot +#<< Import the time rule from the testing module. +import testing ; + +#<< The target we are timing just builds a hello program. +exe hello : hello.cpp ; + +#<< This target records the time to build the `hello` target. +time hello.time : hello ; +#] diff --git a/src/boost/tools/build/example/time/readme.qbk b/src/boost/tools/build/example/time/readme.qbk new file mode 100644 index 00000000..808a2cee --- /dev/null +++ b/src/boost/tools/build/example/time/readme.qbk @@ -0,0 +1,47 @@ +[/ +Copyright 2017 Rene Rivera +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) +] + +[section Time Action] + +This example shows how to use the `testing.time` utility to show time +information for building a target. + +Files: + +* [@../../example/time/jamroot.jam jamroot.jam] +* [@../../example/time/hello.cpp hello.cpp] + +Our `jamroot.jam` specifies the target we build and the `time` +declaration to time the target we build: + +[import jamroot.jam] + +[jamroot] + +Building the example yields: + +[teletype] +``` +> cd /example/time +> b2 +...found 9 targets... +...updating 6 targets... +common.mkdir bin +common.mkdir bin/clang-darwin-4.2.1 +common.mkdir bin/clang-darwin-4.2.1/debug +clang-darwin.compile.c++ bin/clang-darwin-4.2.1/debug/hello.o +clang-darwin.link bin/clang-darwin-4.2.1/debug/hello +testing.time bin/clang-darwin-4.2.1/debug/hello.time +user: [hello] 0.013509 +system: [hello] 0.045641 +clock: [hello] 0.000000 +...updated 6 targets... +``` + +[note The actual paths in the `bin` sub-directory will depend on your +toolset.] + +[endsect] |