MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / duration_example1

Function duration_example1

examples/src/msgpack_examples.cpp:123–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void duration_example1()
124{
125 std::vector<uint8_t> data = {
126 0xd6, // fixext 4 stores an integer and a byte array whose length is 4 bytes
127 0xff, // timestamp
128 0x5a,0x4a,0xf6,0xa5 // 1514862245
129 };
130 auto seconds = msgpack::decode_msgpack<std::chrono::seconds>(data);
131 std::cout << "Seconds elapsed since 1970-01-01 00:00:00 UTC: " << seconds.count() << "\n";
132}
133
134void duration_example2()
135{

Callers 1

mainFunction · 0.70

Calls 1

countMethod · 0.45

Tested by

no test coverage detected