Skip to content

Commit

Permalink
fix some usage of printf for cleaner compile on Mac. Add clion build …
Browse files Browse the repository at this point in the history
…dir to gitignore.
  • Loading branch information
tmontgomery committed Dec 7, 2016
1 parent b2776d3 commit c7890c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ out
build-local.properties
.gradle
build
cmake-build-debug

# cpp build linux
cppbuild/CMakeCache.txt
Expand Down
9 changes: 6 additions & 3 deletions aeron-samples/src/main/cpp/Ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include "FragmentAssembler.h"
#include "Configuration.h"

#define __STDC_FORMAT_MACROS
#include <inttypes.h>

extern "C"
{
#include <hdr_histogram.h>
Expand Down Expand Up @@ -211,11 +214,11 @@ int main(int argc, char **argv)

const steady_clock::time_point start = steady_clock::now();

printf("Warming up the media driver with %'ld messages of length %d bytes\n", warmupSettings.numberOfWarmupMessages, warmupSettings.messageLength);
std::printf("Warming up the media driver with %'ld messages of length %d bytes\n", warmupSettings.numberOfWarmupMessages, warmupSettings.messageLength);
sendPingAndReceivePong([](AtomicBuffer&, index_t, index_t, Header&){}, pingPublication, pongSubscription, warmupSettings);
std::int64_t nanoDuration = duration<std::int64_t, std::nano>(steady_clock::now() - start).count();

printf("Warmed up the media driver in %'ld [ns]\n", nanoDuration);
std::printf("Warmed up the media driver in %'" PRId64 " [ns]\n", nanoDuration);
}

hdr_histogram* histogram;
Expand All @@ -237,7 +240,7 @@ int main(int argc, char **argv)
hdr_record_value(histogram, nanoRtt);
});

printf("Pinging %'ld messages of length %d bytes\n", settings.numberOfMessages, settings.messageLength);
std::printf("Pinging %'ld messages of length %d bytes\n", settings.numberOfMessages, settings.messageLength);

sendPingAndReceivePong(fragmentAssembler.handler(), pingPublication, pongSubscription, settings);

Expand Down

0 comments on commit c7890c9

Please sign in to comment.