Sleep weirdness

Okay, once again deep in the weeds. I’m working on emulating granular synthesis, and I’m running into a weird behavior with very long arrays.
When I run this code, which should take roughly 0.07 beats per loop, the loops seem to slow down over time:

timeline = [0, 0.06026268005371094, 0.14289474487304688, 0.2172393798828125, 0.2809123992919922, 0.3551788330078125, 0.4051856994628906, 0.473876953125, 0.5618534088134766, 0.6155796051025391, 0.7005043029785156, 0.7898921966552734, 0.8737297058105469, 0.9365749359130859, 1.0074901580810547, 1.088052749633789, 1.126739501953125, 1.1969375610351562, 1.2826271057128906, 1.34344482421875, 1.3800640106201172, 1.4378185272216797, 1.5143184661865234, 1.5561180114746094, 1.6012191772460938, 1.6626968383789062, 1.747781753540039, 1.8414344787597656, 1.8777313232421875, 1.9238548278808594, 2.0086822509765625, 2.1016674041748047, 2.177032470703125, 2.2234325408935547, 2.2700157165527344, 2.3046226501464844, 2.391284942626953, 2.4588470458984375, 2.5293045043945312, 2.609407424926758, 2.6754913330078125, 2.7170257568359375, 2.7667598724365234, 2.8489437103271484, 2.881450653076172, 2.9555187225341797, 2.994853973388672, 3.0857791900634766, 3.1473522186279297, 3.2071170806884766, 3.2451820373535156, 3.3323326110839844, 3.3875732421875, 3.4615249633789062, 3.5289745330810547, 3.5673446655273438, 3.6088409423828125, 3.6902847290039062, 3.776906967163086, 3.853982925415039, 3.915882110595703, 3.959623336791992, 4.024116516113281, 4.104488372802734, 4.1956634521484375, 4.278535842895508, 4.367380142211914, 4.448705673217773, 4.516101837158203, 4.578123092651367, 4.648199081420898, 4.713371276855469, 4.765888214111328, 4.83427619934082, 4.921751022338867, 4.954912185668945, 5.014789581298828, 5.049442291259766, 5.140693664550781, 5.182163238525391, 5.263978958129883, 5.326726913452148, 5.397455215454102, 5.443658828735352, 5.485532760620117, 5.575990676879883, 5.627378463745117, 5.681539535522461, 5.731924057006836, 5.807744979858398, 5.8562774658203125, 5.94757080078125, 6.022003173828125, 6.083995819091797, 6.137090682983398, 6.178775787353516, 6.259859085083008, 6.301513671875, 6.3704681396484375, 6.44207763671875, 6.51226806640625, 6.555448532104492, 6.5981903076171875, 6.663215637207031, 6.7368927001953125, 6.823942184448242, 6.903438568115234, 6.945695877075195, 7.014822006225586, 7.095432281494141, 7.17608642578125, 7.254573822021484, 7.2999420166015625, 7.349252700805664, 7.391153335571289, 7.447818756103516, 7.541252136230469, 7.614208221435547, 7.6936187744140625, 7.785518646240234, 7.834907531738281, 7.913825988769531, 7.967708587646484, 8.025819778442383, 8.091506958007812, 8.134389877319336, 8.212648391723633, 8.269607543945312, 8.318246841430664, 8.393745422363281, 8.476543426513672, 8.560859680175781, 8.62989616394043, 8.715963363647461, 8.76628303527832, 8.809097290039062, 8.887664794921875, 8.972038269042969, 9.031423568725586, 9.113094329833984, 9.188701629638672, 9.276344299316406, 9.331279754638672, 9.421443939208984, 9.45914077758789, 9.50851821899414, 9.571371078491211, 9.64143180847168, 9.691598892211914, 9.779680252075195, 9.871801376342773, 9.921810150146484, 9.981746673583984, 10.019052505493164, 10.102115631103516, 10.134256362915039, 10.190593719482422, 10.232032775878906, 10.291053771972656, 10.338703155517578, 10.410453796386719, 10.503681182861328, 10.583829879760742, 10.626598358154297, 10.702291488647461, 10.787881851196289, 10.877197265625, 10.959344863891602, 11.036727905273438, 11.085641860961914, 11.158638000488281, 11.222600936889648, 11.294145584106445, 11.373825073242188, 11.415590286254883, 11.472265243530273, 11.515708923339844, 11.575775146484375, 11.613649368286133, 11.653301239013672, 11.73128890991211, 11.767574310302734, 11.82066535949707, 11.893024444580078, 11.929332733154297, 11.99240493774414]
timeline.each_with_index do |thistime, i|
  puts thistime
  if i < timeline.length
    sleep timeline[i+1]
  end
end


Any idea what’s going on here? Is there a way to optimize this?

OK, never mind… it was a bug in my programming. Each one runs longer and longer… it should be next time - current time.