When tracking IO timing for WAL, the duration is what we calculate
based on the start and end timestamps, it's not what the variable
contains. Rename the timestamp variable to end to better communicate
what it contains.  Original patch by Krishnakumar with additional
hacking to fix another occurrence by me.
Author: Krishnakumar R <
[email protected]>
Discussion: https://postgr.es/m/CAPMWgZ9f9o8awrQpjo8oxnNQ=bMDVPx00NE0QcDzvHD_ZrdLPw@mail.gmail.com
 
                 */
                if (track_wal_io_timing)
                {
-                   instr_time  duration;
+                   instr_time  end;
 
-                   INSTR_TIME_SET_CURRENT(duration);
-                   INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_write_time, duration, start);
+                   INSTR_TIME_SET_CURRENT(end);
+                   INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_write_time, end, start);
                }
 
                PendingWalStats.wal_write++;
     */
    if (track_wal_io_timing)
    {
-       instr_time  duration;
+       instr_time  end;
 
-       INSTR_TIME_SET_CURRENT(duration);
-       INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_sync_time, duration, start);
+       INSTR_TIME_SET_CURRENT(end);
+       INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_sync_time, end, start);
    }
 
    PendingWalStats.wal_sync++;