Tiki in tempo reale - pagina 15

 
Yuriy Zaytsev:

Ma guardo il log, e il log mostra lo stesso tick con una differenza di 4 secondi.

p.s.

Odio la frase "non può essere", mi sono abituato all'idea che tutto può succedere.

A proposito, forse è lontano dall'argomento, ma una volta sull'affermazione che la terra è rotonda ha anche detto qualcosa come questo - "non può essere.

In generale sono sempre in dubbio fino a quando non controllo e poi ricontrollo, e preferibilmente qualcun altro ricontrolla più volte.


Sei sicuro di non incasinare il codice che genera il log ed elabora i dati? Sono 4 secondi di differenza.

Le zecche sono già nel terminale, cioè sono già state inviate sulla rete.

Mettere il codice nel dominio pubblico

if(SymbolInfoTick(Symbol(), s_tick) == true)
  {
    Print("SymbolInfoTick: ",GetTickDescription(s_tick));
  }

E vedete voi stessi.

 
prostotrader:

I tic sono già nel terminale, cioè sono già stati trasmessi sulla rete.

Metteteci il codice di accesso aperto

E vedete voi stessi.

Grazie, farò una prova, seguo l'argomento da molto tempo, sono più interessato come ricercatore.

questo codice ha ritardato di 4 secondi?

//+------------------------------------------------------------------+
//|                                                   Ticks_test.mq5 |
//|                                      Copyright 2019 prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019 prostotrader"
#property link      "https://www.mql5.com"
#property version   "1.00"
//---
bool is_book;
MqlTick ticks[], s_tick;
ulong last_time, mem_cnt, tot_cnt;
bool is_first;
int t_cnt, result;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
  tot_cnt = 0;
  is_book = MarketBookAdd(Symbol());
  result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, 0, 1);
  if(result > 0)
  {
    last_time = ulong(ticks[0].time_msc); //запоминаем время последнего известного тика
    is_first = true;
  }
  else
  {
    is_first = false;
    Alert("No start time!");
    return(INIT_FAILED);
  } 
  ArraySetAsSeries(ticks, true);  
  return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+ 
//| возвращает строковое описание тика                               | 
//+------------------------------------------------------------------+ 
string GetTickDescription(MqlTick &tick) 
  { 
   string res = string(tick.time) + "." +  string(tick.time_msc%1000); 
// 
   bool buy_tick = ((tick.flags&TICK_FLAG_BUY)==TICK_FLAG_BUY); 
   bool sell_tick = ((tick.flags&TICK_FLAG_SELL)==TICK_FLAG_SELL); 
   bool ask_tick = ((tick.flags&TICK_FLAG_ASK)==TICK_FLAG_ASK); 
   bool bid_tick = ((tick.flags&TICK_FLAG_BID)==TICK_FLAG_BID); 
   bool last_tick = ((tick.flags&TICK_FLAG_LAST)==TICK_FLAG_LAST); 
   bool volume_tick = ((tick.flags&TICK_FLAG_VOLUME)==TICK_FLAG_VOLUME); 
// 
   if((buy_tick== true) || (sell_tick == true)) 
   { 
     res = res + (buy_tick?StringFormat(" Buy Tick: Last=%G Volume=%d ",tick.last,tick.volume):""); 
     res = res + (sell_tick?StringFormat(" Sell Tick: Last=%G Volume=%d ",tick.last,tick.volume):""); 
     res = res + (ask_tick?StringFormat(" Ask=%G ",tick.ask):""); 
     res = res + (bid_tick?StringFormat(" Bid=%G ",tick.bid):""); 
   } 
   else 
   { 
     res = res + (ask_tick?StringFormat(" Ask=%G ",tick.ask):""); 
     res = res + (bid_tick?StringFormat(" Bid=%G ",tick.bid):""); 
     res = res + (last_tick?StringFormat(" Last=%G ",tick.last):""); 
     res = res + (volume_tick?StringFormat(" Volume=%d ",tick.volume):""); 
   } 
   return res; 
  } 
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
  if(is_book == true) MarketBookRelease(Symbol());
}
//+------------------------------------------------------------------+
//| BookEvent function                                               |
//+------------------------------------------------------------------+
void OnBookEvent(const string &symbol)
{
  if(symbol != Symbol()) return;
  tot_cnt++;
  if(SymbolInfoTick(Symbol(), s_tick) == true)
  {
    Print("SymbolInfoTick: ",GetTickDescription(s_tick));
  }
  if(is_first == true)
  {
    result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, last_time, 0); //копируем все вновь пришедшие тики от последнего известного времени
    if(result > 0)
    {
      t_cnt = 0;
      for(int i= 0; i<result; i++)
      {
        if(ticks[i].time_msc == ticks[0].time_msc) t_cnt++;             //Считаем кол-во тиков с одинаковым временем
        Print(__FUNCTION__, ": ",GetTickDescription(ticks[i]));
      }
    //  l_tick = ticks[0];
      is_first = false;
      last_time = ulong(ticks[0].time_msc);                             //Запоминаем время последнего тика
    } 
  }
  else
  {
    if(SymbolInfoTick(Symbol(), s_tick) == true)
    {
      Print("SymbolInfoTick: ",GetTickDescription(s_tick));
    }
    result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, last_time, 0); //забираем тики из последнего (посчитанного пакета тикив и считываем тики из нового пакета)
    if(result > 0)
    {
     // l_tick = ticks[0];
      if(result > t_cnt)
      {
        mem_cnt = t_cnt;
        t_cnt = 0;
        for(int i= 0; i<(result - int(mem_cnt)); i++)
        {
          if(ticks[i].time_msc == ticks[0].time_msc) t_cnt++;           //Считаем кол-во тиков с одинаковым временем
          Print(__FUNCTION__, ": ",GetTickDescription(ticks[i]));
        } 
        if(last_time == ulong(ticks[0].time_msc))
        {
          t_cnt += int(mem_cnt);
        }
        else last_time = ulong(ticks[0].time_msc);
      }
      else
      {
        Print(__FUNCTION__, ": Pending order!");                          //Изменения стакана (добавлен/удален отложенный ордер)
      }
    }
    else
    {
      Print(__FUNCTION__, ": Pending order!");                          //Изменения стакана (добавлен/удален отложенный ордер)
    }
  }
}
//+------------------------------------------------------------------+
 

Non sembra essere questo.

non vedere OnTick nel codice

 

Apparentemente questo era il codice in questione

//+------------------------------------------------------------------+
//|                                                   Ticks_test.mq5 |
//|                                      Copyright 2019 prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019 prostotrader"
#property link      "https://www.mql5.com"
#property version   "1.00"
//---
bool is_book;
MqlTick ticks[];
ulong last_time, mem_cnt, tot_cnt;
bool is_first;
int t_cnt, result;
enum ENUM_BOOK_OR_TICK
{
        USE_BOOK,       // Use OnBookEvent
        USE_TICK        // Use OnTick
};

input ENUM_BOOK_OR_TICK Mode = USE_BOOK;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
  tot_cnt = 0;
  if(Mode == USE_BOOK) is_book = MarketBookAdd(Symbol());
  result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, 0, 1);
  if(result > 0)
  {
    last_time = ulong(ticks[0].time_msc); //запоминаем время последнего известного тика
    is_first = true;
  }
  else
  {
    is_first = false;
    Alert("No start time!");
    return(INIT_FAILED);
  } 
  ArraySetAsSeries(ticks, true);  
  return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+ 
//| возвращает строковое описание тика                               | 
//+------------------------------------------------------------------+ 
string GetTickDescription(MqlTick &tick) 
  { 
   string res = string(tick.time) + "." +  string(tick.time_msc%1000); 
// 
   bool buy_tick = ((tick.flags&TICK_FLAG_BUY)==TICK_FLAG_BUY); 
   bool sell_tick = ((tick.flags&TICK_FLAG_SELL)==TICK_FLAG_SELL); 
   bool ask_tick = ((tick.flags&TICK_FLAG_ASK)==TICK_FLAG_ASK); 
   bool bid_tick = ((tick.flags&TICK_FLAG_BID)==TICK_FLAG_BID); 
   bool last_tick = ((tick.flags&TICK_FLAG_LAST)==TICK_FLAG_LAST); 
   bool volume_tick = ((tick.flags&TICK_FLAG_VOLUME)==TICK_FLAG_VOLUME); 
// 
   if((buy_tick== true) || (sell_tick == true)) 
   { 
     res = res + (buy_tick?StringFormat(" Buy Tick: Last=%G Volume=%d ",tick.last,tick.volume):""); 
     res = res + (sell_tick?StringFormat(" Sell Tick: Last=%G Volume=%d ",tick.last,tick.volume):""); 
     res = res + (ask_tick?StringFormat(" Ask=%G ",tick.ask):""); 
     res = res + (bid_tick?StringFormat(" Bid=%G ",tick.bid):""); 
   } 
   else 
   { 
     res = res + (ask_tick?StringFormat(" Ask=%G ",tick.ask):""); 
     res = res + (bid_tick?StringFormat(" Bid=%G ",tick.bid):""); 
     res = res + (last_tick?StringFormat(" Last=%G ",tick.last):""); 
     res = res + (volume_tick?StringFormat(" Volume=%d ",tick.volume):""); 
   } 
   return res; 
  } 
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
  if(Mode == USE_BOOK)
  {
    Print("USE_BOOK ticks received: ", tot_cnt);
    if(is_book == true) MarketBookRelease(Symbol());
  }
  else
  {
    Print("USE_TICK ticks received: ", tot_cnt);
  }  
}
//+------------------------------------------------------------------+
//| BookEvent function                                               |
//+------------------------------------------------------------------+
void OnBookEvent(const string &symbol)
{
  if ( Mode != USE_BOOK || symbol != Symbol() ) return;
  tot_cnt++;
  if(is_first == true)
  {
    result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, last_time, 0); //копируем все вновь пришедшие тики от последнего известного времени
    if(result > 0)
    {
      t_cnt = 0;
      for(int i= 0; i<result; i++)
      {
        if(ticks[i].time_msc == ticks[0].time_msc) t_cnt++;             //Считаем кол-во тиков с одинаковым временем
        Print(__FUNCTION__, ": ",GetTickDescription(ticks[i]));
      }
      is_first = false;
      last_time = ulong(ticks[0].time_msc);                             //Запоминаем время последнего тика
    } 
  }
  else
  {
    result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, last_time, 0); //забираем тики из последнего (посчитанного пакета тикив и считываем тики из нового пакета)
    if(result > 0)
    {
      if(result > t_cnt)
      {
        mem_cnt = t_cnt;
        t_cnt = 0;
        for(int i= 0; i<(result - int(mem_cnt)); i++)
        {
          if(ticks[i].time_msc == ticks[0].time_msc) t_cnt++;           //Считаем кол-во тиков с одинаковым временем
          Print(__FUNCTION__, ": ",GetTickDescription(ticks[i]));
        } 
        if(last_time == ulong(ticks[0].time_msc))
        {
          t_cnt += int(mem_cnt);
        }
        else last_time = ulong(ticks[0].time_msc);
      }
      else
      {
        Print(__FUNCTION__, ": Pending order!");                          //Изменения стакана (добавлен/удален отложенный ордер)
      }
    }
    else
    {
      Print(__FUNCTION__, ": Pending order!");                            //Изменения стакана (добавлен/удален отложенный ордер)
    }
  }
}
//+------------------------------------------------------------------+
//| OnTick function                                                  |
//+------------------------------------------------------------------+
void OnTick()
{
  if ( Mode != USE_TICK ) return;
  tot_cnt++;
  if(is_first == true)
  {
    result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, last_time, 0); //копируем все вновь пришедшие тики от последнего известного времени
    if(result > 0)
    {
      t_cnt = 0;
      for(int i= 0; i<result; i++)
      {
        if(ticks[i].time_msc == ticks[0].time_msc) t_cnt++;             //Считаем кол-во тиков с одинаковым временем
        Print(__FUNCTION__, ": ",GetTickDescription(ticks[i]));
      }
      is_first = false;
      last_time = ulong(ticks[0].time_msc);                             //Запоминаем время последнего тика
    } 
  }
  else
  {
    result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, last_time, 0); //забираем тики из последнего (посчитанного пакета тикив и считываем тики из нового пакета)
    if(result > 0)
    {
      if(result > t_cnt)
      {
        mem_cnt = t_cnt;
        t_cnt = 0;
        for(int i= 0; i<(result - int(mem_cnt)); i++)
        {
          if(ticks[i].time_msc == ticks[0].time_msc) t_cnt++;           //Считаем кол-во тиков с одинаковым временем
          Print(__FUNCTION__, ": ",GetTickDescription(ticks[i]));
        } 
        if(last_time == ulong(ticks[0].time_msc))
        {
          t_cnt += int(mem_cnt);
        }
        else last_time = ulong(ticks[0].time_msc);
      }
      else
      {
        Print(__FUNCTION__, ": Pending order!");                          //Изменения стакана (добавлен/удален отложенный ордер)
      }
    }
    else
    {
      Print(__FUNCTION__, ": Pending order!");                          //Изменения стакана (добавлен/удален отложенный ордер)
    }
  }
}
//+------------------------------------------------------------------+
 

Ho aggiunto il mio tempo al codice.

Ricordo il momento in cui OnTick() è stato attivato(t_time = GetMicrosecondCount();)

Poi prendo tempo, quando ogni funzione viene eseguita

   t_time = GetMicrosecondCount();
//  if(symbol != Symbol()) return;
  //tot_cnt++;
  if(SymbolInfoTick(Symbol(), s_tick) == true)
  {
    func_time = GetMicrosecondCount();
    Print("SymbolInfoTick: time = ", string(func_time - t_time), " mcs ", GetTickDescription(s_tick));
  }
  double a_ask, a_bid, a_last;
  if (SymbolInfoDouble(Symbol(), SYMBOL_ASK, a_ask) == true)
  {
    func_time = GetMicrosecondCount();
    Print("SymbolInfoDouble: time = ", string(func_time - t_time), " mcs ", "ask = ", a_ask);
  }
  if (SymbolInfoDouble(Symbol(), SYMBOL_BID, a_bid) == true)
  {
    func_time = GetMicrosecondCount();
    Print("SymbolInfoDouble: time = ", string(func_time - t_time), " mcs ", "bid = ", a_bid);
  }
  if (SymbolInfoDouble(Symbol(), SYMBOL_LAST, a_last) == true)
  {
    func_time = GetMicrosecondCount();
    Print("SymbolInfoDouble: time = ", string(func_time - t_time), " mcs ", "last = ", a_last);
  }
  if(is_first == true)
  {
    result = CopyTicks(Symbol(), ticks, COPY_TICKS_ALL, last_time, 0); //копируем все вновь пришедшие тики от последнего известного времени
    if(result > 0)
    {
      func_time = GetMicrosecondCount();
      t_cnt = 0;
      for(int i= 0; i<result; i++)
      {
        if(ticks[i].time_msc == ticks[0].time_msc) t_cnt++;             //Считаем кол-во тиков с одинаковым временем
        Print(__FUNCTION__, ": time = ", string(func_time - t_time), " mcs ", GetTickDescription(ticks[i]));

Il risultato è

2020.02.04 13:09:13.101 Ticks_test (GOLD-3.20,M1)       SymbolInfoTick: time = 2 mcs 2020.02.04 13:09:10.720 Bid=1573.1 
2020.02.04 13:09:13.101 Ticks_test (GOLD-3.20,M1)       SymbolInfoDouble: time = 28 mcs ask = 1573.3
2020.02.04 13:09:13.101 Ticks_test (GOLD-3.20,M1)       SymbolInfoDouble: time = 33 mcs bid = 1573.1
2020.02.04 13:09:13.101 Ticks_test (GOLD-3.20,M1)       SymbolInfoDouble: time = 36 mcs last = 1573.4
2020.02.04 13:09:13.101 Ticks_test (GOLD-3.20,M1)       OnTick: time = 41 mcs 2020.02.04 13:09:10.720 Bid=1573.1 
2020.02.04 13:09:13.101 Ticks_test (GOLD-3.20,M1)       OnTick: time = 41 mcs 2020.02.04 13:09:00.328 Ask=1573.3 

Cioè il tempo di esecuzione di ogni funzione è inferiore a 50 microsecondi!

Da dove possono venire 4 secondi?

Penso che due EAs erano in esecuzione in un terminale e il terminale semplicemente non ha il tempo di

Semplicemente non ha il tempo di "fondere" tutte le informazioni in un unico registro, quindi imposta l'ora locale come ritiene necessario.

 
prostotrader:

Nel trading, personalmente, uso ordini asincroni.

Il fatto è che (se fai trading serio in borsa), hai bisogno di tutti i cambiamenti del mercato azionario,

e prima arriva questo evento, meglio è.

Io, per quanto mi riguarda, non vedo alternative a OnBook

In linea di principio, è possibile sollevare l'invocazione diretta delle operazioni commerciali da OnBook. Tutto quello che devi fare in OnBook è formare un flag per eseguire l'operazione e trattare il flag stesso altrove. Cioè, l'operazione stessa dovrebbe essere avviata in un'altra procedura dal flag formato, che creerà un evento, ma dopo aver lasciato la procedura HeBook, e quindi il codice OnBook stesso sarà libero da operazioni pesanti. Tuttavia, se gli ordini sono aperti in modo asincrono, e non c'è un'elaborazione folle di condizioni, è improbabile che causino ritardi significativi.

 
prostotrader:

Ho aggiunto il mio tempo al codice.

Ricordo il momento in cui OnTick() è stato attivato(t_time = GetMicrosecondCount();)

Poi prendo tempo, quando ogni funzione viene eseguita

Il risultato è

Cioè il tempo di esecuzione di ogni funzione è inferiore a 50 microsecondi!

Da dove possono venire 4 secondi?

Penso che due EAs erano in esecuzione in un terminale e il terminale semplicemente non ha il tempo di

Il terminale semplicemente non ha il tempo di "scaricare" tutte le informazioni in un file di log ed è per questo che imposta l'ora locale come ritiene necessario.

Credo che sia vero, un ritardo così selvaggio non è realistico.


1 - FLUSH ha funzionato quando MQ lo ha deciso da solo!

2 - Ritardo tecnico nella scrittura su disco a causa del lavoro intensivo sul disco rigido


È possibile che ci sia già una coda di scrittura sulla vostra macchina locale - il che è abbastanza reale, ho avuto l'esperienza di diversi terabyte di backup riversati sul disco

Posso solo supporre quanto segue:

Ho avuto diversi terabyte di backup scaricati sul disco, ad esempio se ho eseguito Microsoft office, aggiornato il mio Windows e registrato filmati da Internet, o se ho lavorato con MS SQL sulla macchina locale allo stesso tempo,

fare un paio di backup, avere una dozzina di 4 torrenti e due o tre dozzine di programmi che scrivono intensamente su disco.

Cioè voglio dire che se c'è stato un lavoro intensivo con il disco - è possibile e c'è stato un ritardo nella scrittura del registro su disco.

 
Yuriy Zaytsev:

Probabilmente vero, non realistico con un ritardo così selvaggio.


1 - FLUSH ha funzionato quando MQ lo ha deciso da solo!

2 - Ritardo tecnico nella scrittura su disco causato da un lavoro intensivo sul disco rigido.


È possibile che qualche coda sia già sulla vostra macchina locale per la registrazione - il che è abbastanza reale, ho avuto l'esperienza di diversi terabyte di backup riversati sul disco

Posso solo supporre quanto segue:

Ho avuto diversi terabyte di backup scaricati sul disco, ad esempio se ho eseguito Mac irosoft office, aggiornato il mio Windows e registrato filmati da Internet, o se ho lavorato con MS SQL sulla macchina locale allo stesso tempo,

fare un paio di backup, avere una dozzina di 4 torrenti e due o tre dozzine di programmi che scrivono intensamente su disco.

Voglio dire che se c'è stato un lavoro intensivo con il disco - è abbastanza possibile che ci sia stato un ritardo nella registrazione su disco.

Difficilmente legato al disco, MT mette il tempo già quando scrive il registro nella sua cache. Questo è quello che ho pensato il terminale in generale per 4 sec può essere legato al carico generale del sistema, più probabilmente RAM e CPU.
 
prostotrader:

Ho aggiunto il mio tempo al codice.

Ricordo il momento in cui OnTick() è stato attivato(t_time = GetMicrosecondCount();)

Poi prendo tempo, quando ogni funzione viene eseguita

Il risultato è

Cioè il tempo di esecuzione di ogni funzione è inferiore a 50 microsecondi!

Da dove possono venire 4 secondi?

Penso che due EAs erano in esecuzione in un terminale e il terminale semplicemente non ha il tempo di

Pertanto, fissa l'ora locale come ritiene necessario".

A proposito - in modo da non farsi prendere dal tempo di registrazione - si può aggiungere l'ora locale all'array - che si forma nel codice - qui sotto

Allora ci sarà una chiara differenza nel log tra il momento in cui il terminale ha resettato il log su disco e il momento in cui il tick o l'evento di OnBook è arrivato localmente.

E questo sarà più corretto dal punto di vista della ricerca.

//+------------------------------------------------------------------+ 
//| возвращает строковое описание тика                               | 
//+------------------------------------------------------------------+ 
string GetTickDescription(MqlTick &tick) 
  { 
   string res = string(tick.time) + "." +  string(tick.time_msc%1000); 
// 
   bool buy_tick = ((tick.flags&TICK_FLAG_BUY)==TICK_FLAG_BUY); 
   bool sell_tick = ((tick.flags&TICK_FLAG_SELL)==TICK_FLAG_SELL); 
   bool ask_tick = ((tick.flags&TICK_FLAG_ASK)==TICK_FLAG_ASK); 
   bool bid_tick = ((tick.flags&TICK_FLAG_BID)==TICK_FLAG_BID); 
   bool last_tick = ((tick.flags&TICK_FLAG_LAST)==TICK_FLAG_LAST); 
   bool volume_tick = ((tick.flags&TICK_FLAG_VOLUME)==TICK_FLAG_VOLUME); 
// 
   if((buy_tick== true) || (sell_tick == true)) 
   { 
     res = res + (buy_tick?StringFormat(" Buy Tick: Last=%G Volume=%d ",tick.last,tick.volume):""); 
     res = res + (sell_tick?StringFormat(" Sell Tick: Last=%G Volume=%d ",tick.last,tick.volume):""); 
     res = res + (ask_tick?StringFormat(" Ask=%G ",tick.ask):""); 
     res = res + (bid_tick?StringFormat(" Bid=%G ",tick.bid):""); 
   } 
   else 
   { 
     res = res + (ask_tick?StringFormat(" Ask=%G ",tick.ask):""); 
     res = res + (bid_tick?StringFormat(" Bid=%G ",tick.bid):""); 
     res = res + (last_tick?StringFormat(" Last=%G ",tick.last):""); 
     res = res + (volume_tick?StringFormat(" Volume=%d ",tick.volume):""); 
   } 
   return res; 
  } 
 
Aleksey Mavrin:
Difficilmente collegato al disco, MT imposta il tempo già quando scrive il registro nella sua cache. Questo è quello che ho pensato il terminale in generale per 4 secondi può essere legato al carico complessivo del sistema, piuttosto RAM e CPU.

SEI SICURO DI QUESTO?


4 secondi ????, no! Pensate davvero che il processore sia bloccato per 4 secondi o che la memoria sia stata liberata per 4 secondi?

È più probabile che sia la coda di scrittura sul disco.

Il disco è più lento della memoria e del processore.

Il comando flush() è un comando C, probabilmente lo conoscete e viene eseguito quando vi fa comodo e può essere ritardato più spesso a causa dell'avvio del disco.

È così che si chiama quando si vuole scaricare i buffer su disco.