Boost C++ Libraries

PrevUpHomeNext

Time Action

This example shows how to use the testing.time utility to show time information for building a target.

Files:

Our jamroot.jam specifies the target we build and the time declaration to time the target we build:

1import testing ;

2exe hello : hello.cpp ;

3time hello.time : hello ;

1

Import the time rule from the testing module.

2

The target we are timing just builds a hello program.

3

This target records the time to build the hello target.

Building the example yields:

> 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.


PrevUpHomeNext