Commit 23bd707d by SongXinkai

20181022

parent a16b841b
git_repository(
name = "com_github_nelhage_rules_boost",
commit = "8a8853fd755496288995a603ce9aa2685709cd39",
remote = "https://github.com/nelhage/rules_boost",
)
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()
c
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__/bazel-out/k8-fastbuild/bin
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__/bazel-out/k8-fastbuild/genfiles
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__/bazel-out
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__/bazel-out/k8-fastbuild/testlogs
\ No newline at end of file
a
\ No newline at end of file
cc_binary(
name="test1",
srcs=["test1.cpp"],
deps=["@boost//:filesystem"]
)
...@@ -5,8 +5,8 @@ namespace fs = boost::filesystem; ...@@ -5,8 +5,8 @@ namespace fs = boost::filesystem;
using namespace std; using namespace std;
int main(){ int main(){
//cout << fs::exist("a") << endl; cout << fs::exists("a") << endl;
//cout << fs::exist("b") << endl; cout << fs::exists("b") << endl;
cout << fs::is_directory("b") << endl; cout << fs::is_directory("b") << endl;
return 0; return 0;
} }
/root/.cache/bazel/_bazel_root/3ca51cb9a7e10b81b1009271d77d0cd3/execroot/__main__/bazel-out/k8-fastbuild/bin
\ No newline at end of file
/root/.cache/bazel/_bazel_root/3ca51cb9a7e10b81b1009271d77d0cd3/execroot/__main__/bazel-out/k8-fastbuild/genfiles
\ No newline at end of file
/root/.cache/bazel/_bazel_root/3ca51cb9a7e10b81b1009271d77d0cd3/execroot/__main__/bazel-out
\ No newline at end of file
/root/.cache/bazel/_bazel_root/3ca51cb9a7e10b81b1009271d77d0cd3/execroot/__main__
\ No newline at end of file
/root/.cache/bazel/_bazel_root/3ca51cb9a7e10b81b1009271d77d0cd3/execroot/__main__/bazel-out/k8-fastbuild/testlogs
\ No newline at end of file
git_repository(
name = "com_github_nelhage_rules_boost",
commit = "8a8853fd755496288995a603ce9aa2685709cd39",
remote = "https://github.com/nelhage/rules_boost",
)
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()
c
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__/bazel-out/k8-fastbuild/bin
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__/bazel-out/k8-fastbuild/genfiles
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__/bazel-out
\ No newline at end of file
/root/.cache/bazel/_bazel_root/10b47e0969b5a5941f6ac84b9ec5df3b/execroot/__main__/bazel-out/k8-fastbuild/testlogs
\ No newline at end of file
a
\ No newline at end of file
#include <unistd.h>
#include <iostream>
using namespace std;
int main (){
char file_name[] = "b";
if ( 0 == access(file_name, 0) ) cout<<"access(): path exist."<<endl;
return 0;
}
cc_binary(
name="test1",
srcs=["test1.cpp"],
deps=["@boost//:filesystem"]
)
#include <iostream>
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
using namespace std;
int main(){
cout << fs::exists("a") << endl;
cout << fs::exists("b") << endl;
cout << fs::is_directory("b") << endl;
return 0;
}
git_repository(
name = "com_github_nelhage_rules_boost",
commit = "8a8853fd755496288995a603ce9aa2685709cd39",
remote = "https://github.com/nelhage/rules_boost",
)
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()
cc_binary(
name="test1",
srcs=["test1.cpp"],
deps=["@boost//:filesystem"]
)
#include <iostream>
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
using namespace std;
int main(){
cout << fs::exists("a") << endl;
cout << fs::exists("b") << endl;
cout << fs::is_directory("b") << endl;
return 0;
}
File added
#include <iostream>
using namespace std;
int main(){
int a[10];
void* b = (void*)a;
cout << a << ", " << a+1 << endl;
cout << b << ", " << b+1 << endl;
return 0;
}
No preview for this file type
#include <unistd.h> #include <unistd.h>
#include <iostream> #include <iostream>
#include <vector>
#include <time.h> #include <time.h>
using namespace std; using namespace std;
...@@ -10,14 +11,23 @@ int main(){ ...@@ -10,14 +11,23 @@ int main(){
cout << "xx" << endl; cout << "xx" << endl;
} }
time(&a); // time.h time(&a); // time.h
sleep(4); // unistd.h sleep(2); // unistd.h
time(&b); time(&b);
cout << a << ", " << b << endl; cout << a << ", " << b << endl;
cout << b -a << endl; cout << b -a << endl;
clock_t clc_a = 0, clc_b = 0; clock_t clc_a = 0, clc_b = 0;
vector<double> v;
clc_a=clock(); // time.h clc_a=clock(); // time.h
sleep(4); // unistd.h for (int i = 0; i < 100000000; ++i){
v.push_back(double(i)*i);
}
clc_b=clock();
cout << clc_a << ", " << clc_b <<", CLOCKS_PER_SEC: " << CLOCKS_PER_SEC<< endl;
cout << (clc_b - clc_a) / CLOCKS_PER_SEC << endl;
clc_a=clock(); // time.h
sleep(2); // NO CPU clock during sleep
clc_b=clock(); clc_b=clock();
cout << clc_a << ", " << clc_b <<", CLOCKS_PER_SEC: " << CLOCKS_PER_SEC<< endl; cout << clc_a << ", " << clc_b <<", CLOCKS_PER_SEC: " << CLOCKS_PER_SEC<< endl;
cout << (clc_b - clc_a) / CLOCKS_PER_SEC << endl; cout << (clc_b - clc_a) / CLOCKS_PER_SEC << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment