#include <stdlib.h>
#include <unistd.h>
#include <glib.h>
#include <glib/gprintf.h>

/* EXO 1.4 */

int main(int argc, char* argv[]){
  g_printf(" === EXO 2.3  === \n");

  GIOChannel *channel = g_io_channel_unix_new (STDIN_FILENO);
  gchar *str_return;
  gsize length;
  gsize terminator_pos;
  GError *error = NULL;


  GTimer *timer = g_timer_new ();
  
  g_io_channel_read_line (channel, &str_return, &length, &terminator_pos, &error);

  g_timer_stop(timer);
  gdouble time_write  = g_timer_elapsed(timer,NULL);
  g_print(" temps  %f \n", time_write ); 
  
  return EXIT_SUCCESS;
}
