Commit 7b62a7ac authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Merge branch 'master' of https://framagit.org/blibs/blc_program

parents 847c817e 742d4f18
......@@ -273,7 +273,7 @@ void blc_command_loop_end(){
if (blc_profile_file) start_time=timer.tv_sec*1000000+timer.tv_usec;
blc_current_duration=blc_us_time_diff(&timer);
if (blc_profile_file) fprintf(blc_profile_file, "%ld\t%lld\t%lu\t\n",profile_timer.tv_sec*1000000+profile_timer.tv_usec, start_time, blc_current_duration);
if (blc_profile_file) fprintf(blc_profile_file, "%16ld\t%16lld\t%8lu\t\n",profile_timer.tv_sec*1000000+profile_timer.tv_usec, start_time, blc_current_duration);
// fflush(stderr);
//We post the semaphore usualy to say the data is ready to read
......
......@@ -456,10 +456,8 @@ void blc_program_init(int *argc, char ***argv, void (*exit_cb)(void))
blc_input_terminal=isatty(STDIN_FILENO);
blc_output_terminal=isatty(STDOUT_FILENO);
if (isatty(STDERR_FILENO) && blc_input_terminal) {
blc_stderr_ansi_detect();
if (!blc_stderr_ansi) fprintf(stderr, "o ansi terminal. There is no color.\n"); //The n of no is displayed byt he terminale itself.
}
if (isatty(STDERR_FILENO) && blc_input_terminal) blc_stderr_ansi=1;
else blc_stderr_ansi; //This is not waranty. It is safer to use blc_stderr_ansi_detect but it causes trouble when many program are launched at once
blc_program_add_option(&profile, '~', "profile", "filename", "profile the execution of the loop", NULL);
blc_program_add_option(&help, 'h', "help", 0, "display this help", NULL);
......@@ -467,9 +465,9 @@ void blc_program_init(int *argc, char ***argv, void (*exit_cb)(void))
if (profile){
SYSTEM_ERROR_CHECK(blc_profile_file=fopen(profile, "w"), NULL, "filename: %s", profile);
fprintf(blc_profile_file, "#start_time\tduration\t\n");
fprintf(blc_profile_file, "#start_time(µs) \texec_time(µs) \tduration(µs) \t\n");
gettimeofday(&timer, NULL);
fprintf(blc_profile_file, "%lu\t0\t0\t\n", timer.tv_sec*1000000+timer.tv_usec);
fprintf(blc_profile_file, "%16lu\t 0\t 0\t\n", timer.tv_sec*1000000+timer.tv_usec);
}
if (help){
......
Supports Markdown
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