rijo / exectime Goto Github PK
View Code? Open in Web Editor NEW[c++] Time measurer for specific command used for performance testing
License: GNU General Public License v3.0
[c++] Time measurer for specific command used for performance testing
License: GNU General Public License v3.0
g++:
$make debug
g++ -std=c++14 -Wall -Werror -Wextra -Wpedantic -Wshadow -pthread -g -D=DEBUG src/main.cpp -o exectime
In file included from src/main.cpp:2:0:
src/statistics.hpp: I funktion ”statistics::statistics_t statistics::calculate(const TContainer&, std::function<TValue(const TItem&)>)”:
src/statistics.hpp:34:9: fel: ”vector” är inte en medlem av ”std”
std::vector values;
^~~
src/statistics.hpp:34:27: fel: expected primary-expression before ”>” token
std::vector values;
^
src/statistics.hpp:34:29: fel: ”values” deklarerades inte i detta definitionsområde
std::vector values;
^~~~~~
In file included from src/process.hpp:4:0,
from src/main.cpp:3:
src/pipes.hpp: I global räckvidd:
src/pipes.hpp:68:10: fel: ”vector” i namnrymden ”std” är inte namnet på en malltyp
std::vectorstd::string read_stdin(char delimiter, int timeout = 0) {
^~~~~~
make: *** [Makefile:19: exectime] Fel 1
clang++:
$CXX=clang++ make
clang++ -std=c++14 -Wall -Werror -Wextra -Wpedantic -Wshadow -pthread src/main.cpp -o exectime
In file included from src/main.cpp:2:
src/statistics.hpp:34:14: error: no member named 'vector' in namespace 'std'
std::vector values;
~~~~~^
src/statistics.hpp:34:21: error: 'TValue' does not refer to a value
std::vector values;
^
src/statistics.hpp:25:60: note: declared here
template<typename TContainer, typename TItem, typename TValue>
^
src/statistics.hpp:34:29: error: use of undeclared identifier 'values'
std::vector values;
^
src/statistics.hpp:36:13: error: use of undeclared identifier 'values'
values.push_back(selector(item));
^
src/statistics.hpp:37:19: error: use of undeclared identifier 'values'
std::sort(values.begin(), values.end());
^
src/statistics.hpp:37:35: error: use of undeclared identifier 'values'
std::sort(values.begin(), values.end());
^
src/statistics.hpp:41:25: error: use of undeclared identifier 'values'
s.median = (values[s.sample_size / 2 - 1] + values[s.sample_size / 2]) / 2.0;
^
src/statistics.hpp:41:57: error: use of undeclared identifier 'values'
s.median = (values[s.sample_size / 2 - 1] + values[s.sample_size / 2]) / 2.0;
^
src/statistics.hpp:43:24: error: use of undeclared identifier 'values'
s.median = values[s.sample_size / 2];
^
src/statistics.hpp:45:21: error: use of undeclared identifier 'values'
s.maximum = values.back();
^
src/statistics.hpp:46:21: error: use of undeclared identifier 'values'
s.minimum = values.front();
^
src/statistics.hpp:49:35: error: use of undeclared identifier 'values'; did you mean 'value'?
for (const TValue &value: values)
^~~~~~
value
src/statistics.hpp:49:28: note: 'value' declared here
for (const TValue &value: values)
^
src/statistics.hpp:54:35: error: use of undeclared identifier 'values'; did you mean 'value'?
for (const TValue &value: values) {
^~~~~~
value
src/statistics.hpp:54:28: note: 'value' declared here
for (const TValue &value: values) {
^
In file included from src/main.cpp:3:
In file included from src/process.hpp:4:
src/pipes.hpp:68:10: error: no type named 'vector' in namespace 'std'
std::vectorstd::string read_stdin(char delimiter, int timeout = 0) {
~~~~~^
src/pipes.hpp:68:16: error: expected unqualified-id
std::vectorstd::string read_stdin(char delimiter, int timeout = 0) {
^
In file included from src/main.cpp:2:
src/statistics.hpp:49:33: error: invalid range expression of type 'const unsigned long'; no viable 'begin' function available
for (const TValue &value: values)
^
src/main.cpp:244:61: note: in instantiation of function template specialization 'statistics::calculate<std::vector<std::chrono::duration<long, std::ratio<1, 1000000> >, std::allocator<std::chrono::duration<long, std::ratio<1, 1000000> > >
>, std::chrono::duration<long, std::ratio<1, 1000000> >, unsigned long>' requested here
statistics::statistics_t s = statistics::calculate(execution_times, selector);
^
In file included from src/main.cpp:2:
src/statistics.hpp:54:33: error: invalid range expression of type 'const unsigned long'; no viable 'begin' function available
for (const TValue &value: values) {
^
17 errors generated.
make: *** [Makefile:19: exectime] Fel 1
Today it's only possible to define numer of execution iterations. Normally, if one talks about statistics, the target is to gather data until the relative standard error is below a certain level, say 5%. It would've been nice to define this instead of iteration count.
Side note: if iteration count is given, this should probably be used as maximum (or minimum) iterations before giving up.
`[exectime] ((v0.0.3)) (2) $git rev-parse HEAD
9a96e86
[exectime] ((v0.0.3)) $g++ --version
g++ (GCC) 7.1.1 20170516
Copyright © 2017 Free Software Foundation, Inc.
Detta är fri programvara, se källkoden för kopieringsvillkor. Det
finns INGEN garanti, inte ens för KÖP eller LÄMPLIGHET FÖR NÅGOT
SPECIELLT ÄNDAMÅL.
[exectime] ((v0.0.3)) $make
g++ -std=c++14 -Wall -Werror -Wextra -Wpedantic -Wshadow -pthread src/main.cpp -o exectime
In file included from src/main.cpp:4:0:
src/console.hpp: I funktion ”const std::vectorconsole::arg_t console::parse_args(int, const char**)”:
src/console.hpp:269:39: fel: denna sats kan falla igenom [-Werror=implicit-fallthrough=]
args.emplace_back(arg_t{arg, "", nullptr});
^~~~~~~~~~~~~~~~~~~~~~~
src/console.hpp:270:17: anm: här
case 0:
^~~~
cc1plus: alla varningar behandlas som fel
make: *** [Makefile:19: exectime] Fel 1`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.