{"id":296544,"date":"2019-12-28T15:00:10","date_gmt":"2019-12-28T15:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296544"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296544","title":{"rendered":"\u00ab\u041a\u043e\u0433\u0434\u0430 \u0447\u0430\u0441\u044b \u0434\u0432\u0435\u043d\u0430\u0434\u0446\u0430\u0442\u044c \u0431\u044c\u044e\u0442\u00bb. \u0418\u043b\u0438 \u0433\u0438\u0440\u043b\u044f\u043d\u0434\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482168\/\">\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u043e\u0432. \u0418 \u043d\u0430\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0433\u0438\u0440\u043b\u044f\u043d\u0434\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043c\u043e\u0440\u0433\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0418\u043b\u0438, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0446\u0432\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u0443\u043c\u043d\u043e\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443. \u0418 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u2013 \u0432\u0435\u0434\u044c \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u044b, \u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u044b. \u0412\u0441\u0451 \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yo\/1c\/a8\/yo1ca85ahnnxg_5crc1hh84n9ng.jpeg\"><\/p>\n<p>  \u0418, \u0440\u0430\u0437 \u0443\u0436 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0451 \u0438 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435. \u0412\u0435\u0434\u044c \u0435\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0432\u0443\u043a\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e \u0437\u0432\u0443\u0447\u0438\u0442 \u043e\u0434\u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430.<\/p>\n<hr>\n<p><i>\u0421 \u0447\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Web Audio \u0438 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439\u043d\u044b\u0445 \u0447\u0430\u0441\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 javascript-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u00ab\u0447\u0430\u0441\u043e\u0432\u00bb \u0435\u0441\u0442\u044c \u0432 javasctipt (\u0442\u0440\u0438!) \u0438 \u0437\u0430\u0447\u0435\u043c \u0432\u0441\u0435 \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"http:\/\/snowtime.fun\" rel=\"nofollow\">\u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/a> \u0434\u043b\u044f node.js \u2013 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/i><a name=\"habracut\"><\/a><\/p>\n<hr>\n<p>  <\/p>\n<h2>\u0421\u0432\u0435\u0440\u0438\u043c \u0447\u0430\u0441\u044b<\/h2>\n<p>  \u0414\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u043d\u043b\u0430\u0439\u043d-\u0433\u0438\u0440\u043b\u044f\u043d\u0434\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0442\u043e\u0447\u043d\u0430\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0430\u0441\u043e\u0432. \u0412\u0435\u0434\u044c \u0435\u0441\u043b\u0438 \u0447\u0430\u0441\u044b \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0438\u0434\u0443\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 (\u0434\u0430\u0436\u0435 \u043d\u0435\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435) \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043d\u0430\u0431\u0434\u0438\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u00f3\u0439 \u043c\u0435\u0442\u043a\u043e\u0439 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u00ab\u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0435\u00bb. \u0422\u043e\u0433\u0434\u0430 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0438 \u0442\u043e\u0447\u043d\u043e \u0432 \u0441\u0440\u043e\u043a. <\/p>\n<p>  \u0418\u043b\u0438 \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0435\u0449\u0451 \u0434\u0430\u043b\u044c\u0448\u0435 \u2013 \u0432\u0437\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 random-\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043e\u0431\u0449\u0438\u0439 seed (\u0432\u044b\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b, \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438) \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 seed <i>\u0432\u043c\u0435\u0441\u0442\u0435<\/i> \u0441 \u0442\u043e\u0447\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u2013 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435: \u043f\u043e \u0441\u0443\u0442\u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u043d\u0438 \u0441\u0435\u0442\u044c, \u043d\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0442\u043e\u0431\u044b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. Seed \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0432\u0441\u044e (\u0443\u0441\u043b\u043e\u0432\u043d\u043e-\u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e) \u00ab\u0432\u0438\u0434\u0435\u043e\u0437\u0430\u043f\u0438\u0441\u044c\u00bb \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0430\u043f\u0435\u0440\u0451\u0434. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u0442\u043e\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kd\/tx\/tt\/kdtxttvwqoqkb69jvoov077o8vs.gif\">  <\/p>\n<hr>\n<p><i>\u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e\u0441\u0442\u0438. \u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0432\u0432\u043e\u0434\u043e\u043c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0443\u0436\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0434\u0435\u043b\u0430\u0435\u0448\u044c, \u0435\u0433\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u00ab\u043a\u0430\u043a \u0435\u0441\u0442\u044c\u00bb. \u041d\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043e \u2013 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043e. \u0412 \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0441\u0435 \u0442\u0440\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438.<\/i><\/p>\n<hr>\n<p>  <\/p>\n<h2>\u0421\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u00ab\u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u00bb<\/h2>\n<p>  \u0412 \u0438\u0434\u0435\u0430\u043b\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0437\u0432\u0443\u0447\u0430\u043b\u043e \u00ab\u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u00bb \u2013 \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u00b110 \u043c\u0441 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0445\u0443\u0434\u0448\u0435\u0439 \u043f\u0430\u0440\u044b \u0441\u0440\u0435\u0434\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f, \u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 NTP \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0438\u043c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0428\u043b\u0435\u043c \u00ab\u043f\u0438\u043d\u0433\u0438\u00bb \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u00ab\u043f\u043e\u043d\u0433\u0438\u00bb \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u00f3\u0439 \u043c\u0435\u0442\u043a\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0415\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043f\u043e\u0434\u0440\u044f\u0434, \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434: \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">let pingClientTime = ... ; \/\/ time when ping started let pongClientTime = ... ; \/\/ time when pong received let pongServerTime = ... ; \/\/ server timstamp in pong answer let clientServerRawOffset = pongServerTime - pongClientTime; let pingPongOffset = pongClientTime - pingClientTime; \/\/ roundtrip let estimatedPingOffset = pingPongOffset \/ 2; \/\/ one-way let offset = clientServerRawOffset + estimatedPingOffset;  let serverTime = performace.now() + clientServerCalculatedOffset;<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  Websockets \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 TCP-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0438 \u043f\u043e \u043d\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u00ab\u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f\u00bb \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b. \u041d\u0435 UDP \u0438 \u043d\u0435 ICMP, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u043e \u043d\u0435\u0441\u0440\u0430\u0432\u043d\u0438\u043c\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e HTTP API. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, socket.io. \u0422\u0430\u043c \u0432\u0441\u0451 \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434: \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 socket.io<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\/\/ server socket.on('ping', (pongCallback) =&gt; {   let pongServerTime = performace.now();   pongCallback(pongServerTime); });  \/\/client const binSize = 100; let clientServerCalculatedOffset;  function ping() {   socket.emit('ping', pongCallback);   const pingClientTime = performace.now();   function pongCallback(pongServerTime) {     const pongClientTime = performace.now();     const clientServerRawOffset = pongServerTime - pongClientTime;     const pingPongOffset = pongClientTime - pingClientTime; \/\/ roundtrip     const estimatedPingOffset = pingPongOffset \/ 2; \/\/ one-way     const offset = clientServerRawOffset + estimatedPingOffset;     offsets.unshift(offset);     offsets.splice(binSize);     let offsetSum = 0;     offsets.forEach((offset) =&gt; {       offsetSum += offset;     });     clientServerCalculatedOffset = offsetSum \/ offset.length();   } }<\/code><\/pre>\n<p>  <i>\u041d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e, \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u0435\u0434\u0438\u0430\u043d\u0443 \u2013 \u044d\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438. \u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u043c. \u042f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u044e \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u043a\u043e\u0434 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438. \u041c\u043e\u0435 \u043f\u043e\u043b\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/i>  <\/div>\n<\/div>\n<h2>performance.now()<\/h2>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u043e\u0431\u044a\u0435\u043a\u0442 <code>performance<\/code> \u2013 \u044d\u0442\u043e API \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0421\u0440\u0430\u0432\u043d\u0438\u043c:<\/p>\n<ul>\n<li><b><code>Date.now()<\/code><\/b> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434 \u0441 1 \u044f\u043d\u0432\u0430\u0440\u044f 1970, \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432 <b>\u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u043c<\/b> \u0432\u0438\u0434\u0435. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u043e\u0442 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 0.5 \u043c\u0441 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u044f <code>a-b<\/code> \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e \u00ab\u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c\u00bb \u0434\u043e 2 \u043c\u0441. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e, \u0441\u0430\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u00f3\u043b\u044c\u0448\u0438\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/li>\n<li><b><code>performance.now()<\/code><\/b> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/DOMHighResTimeStamp#The_time_origin\" rel=\"nofollow\">c \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/a>. <br \/>  \u042d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0432\u0435\u0436\u0435\u0435 API, \u00ab\u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u043e\u0435\u00bb \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u043e\u0432. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <b>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 c \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439<\/b>, \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0430\u0432\u0430\u044f \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0431\u043b\u0438\u0437\u043a\u0438\u0439 \u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c \u0441\u0430\u043c\u043e\u0439 \u041e\u0421.   <\/li>\n<\/ul>\n<p>  \u0414\u0443\u043c\u0430\u044e, \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u043c javascript \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c. \u041d\u043e \u043d\u0435 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e\u2026<\/p>\n<h2>Spectre<\/h2>\n<p>  \u0418\u0437-\u0437\u0430 \u043d\u0430\u0448\u0443\u043c\u0435\u0432\u0448\u0435\u0439 \u0432 2018 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u0430\u0442\u0430\u043a\u0438 Spectre, \u0432\u0441\u0451 \u0438\u0434\u0435\u0442 \u043a \u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0430\u0439\u043c\u0435\u0440 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0433\u0440\u0443\u0431\u043b\u0435\u043d, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c\u044e. Firefox, \u0435\u0449\u0451 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 60, \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0434\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0430 Edge, \u0438 \u0442\u043e\u0433\u043e \u0445\u0443\u0436\u0435. <\/p>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Performance\/now\" rel=\"nofollow\">MDN<\/a>:<\/p>\n<blockquote><p>The timestamp is not actually high-resolution. To mitigate security threats such as Spectre, browsers currently round the results to varying degrees. (Firefox started rounding to 1 millisecond in Firefox 60.) Some browsers may also slightly randomize the timestamp. The precision may improve again in future releases; browser developers are still investigating these timing attacks and how best to mitigate them.<\/p><\/blockquote>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435\u0441\u0442 \u0438 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0438. \u042d\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0435 10 \u043c\u0441:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430: \u0437\u0430\u043c\u0435\u0440 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0446\u0438\u043a\u043b\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">function measureTimesLoop(length) {   const d = new Array(length);   const p = new Array(length);   for (let i = 0; i &lt; length; i++) {     d[i] = Date.now();     p[i] = performance.now();   }   return { d, p } }<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lt\/rr\/xo\/ltrrxo5m-cfdsf7kpwy_vm0d4nu.png\" align=\"left\"><code>Date.now()<\/code><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hp\/h-\/w3\/hph-w3yafyxorpopqiksdnd6j5g.png\" align=\"left\"><code>performance.now()<\/code><\/p>\n<h3>Edge<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/g2\/t2\/bs\/g2t2bssr-dhq8cbyb95-pwjxclw.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 44.17763.771.0<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.0538336052202284 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.7547819181245603 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.567100970873786 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.6748006785171455 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1.5015000000003056 \u043c\u0441  <\/div>\n<\/div>\n<h3>Firefox<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7y\/6b\/a_\/7y6ba_0b_lgehjq2yko_60ip4am.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 71.0<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.0168350168350169 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.21645930182417966 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.0134453781512605 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.1734108492762375 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1 \u043c\u0441  <\/div>\n<\/div>\n<h3>Chrome<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zv\/_y\/pp\/zv_yppcegrbidigvmp6npdcwzf0.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 79.0.3945.88<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.02442996742671 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.49858684744384 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 0.005555847229948915 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.027497846727194235 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 0.0050000089686363935 \u043c\u0441  <\/div>\n<\/div>\n<p>  Ok, Chrome, zoom to 1 msec.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2o\/9m\/ik\/2o9mikwf_owbi8mn1saodrmd_e8.png\"><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0421hrome \u0432\u0441\u0451 \u0435\u0449\u0435 \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f, \u0438 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>performance.now()<\/code> \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u0434\u0443\u0448\u0435\u043d\u0430 \u0438 \u0448\u0430\u0433 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 0.005 \u043c\u0441. \u041f\u043e\u0434 Edge \u0442\u0430\u0439\u043c\u0435\u0440 <code>performance.now()<\/code> \u0433\u0440\u0443\u0431\u0435\u0435 \u0447\u0435\u043c <code>Date.now()<\/code>! \u0412 Firefox \u043e\u0431\u0430 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0432\u043e\u0434\u044b. \u041d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0442\u0430\u0439\u043c\u0435\u0440 \u0432 javascript (\u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c). <\/p>\n<h2>\u0422\u0430\u0439\u043c\u0435\u0440 WebAudio API<\/h2>\n<p>  \u042d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u043e\u0439 \u0437\u0432\u0435\u0440\u044c. \u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u043e-\u043e\u0447\u0435\u0440\u0435\u0434\u0438. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0430\u0443\u0434\u0438\u043e-\u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0442, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438) \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 javascript: <code>setInterval<\/code> \u0438 <code>setTimeout<\/code> \u2013 \u0438\u0437-\u0437\u0430 \u0438\u0445 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438. \u0418 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c <i>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/i> \u0442\u0430\u0439\u043c\u0435\u0440\u0430, (\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0438\u043c\u0435\u043b\u0438 \u0434\u0435\u043b\u043e \u0440\u0430\u043d\u0435\u0435), \u0430 \u044d\u0442\u043e \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 event-\u043c\u0430\u0448\u0438\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0418 \u043e\u043d\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0436\u0435 \u0447\u0442\u043e-\u0442\u043e \u043e\u043a\u043e\u043b\u043e 5-25 \u043c\u0441 \u0434\u0430\u0436\u0435 \u0432 \u0442\u0435\u043f\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0413\u0440\u0430\u0444\u0438\u043a\u0438 \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0435 100 \u043c\u0441:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430: \u0437\u0430\u043c\u0435\u0440 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">function pause(duration) {   return new Promise((resolve) =&gt; {       setInterval(() =&gt; {         resolve();       }, duration);   }); }  async function measureTimesInAsyncLoop(length) {   const d = new Array(length);   const p = new Array(length);   for (let i = 0; i &lt; length; i++) {     d[i] = Date.now();     p[i] = performance.now();     await pause(1);   }   return { d, p } }<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lt\/rr\/xo\/ltrrxo5m-cfdsf7kpwy_vm0d4nu.png\" align=\"left\"><code>Date.now()<\/code><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hp\/h-\/w3\/hph-w3yafyxorpopqiksdnd6j5g.png\" align=\"left\"><code>performance.now()<\/code><\/p>\n<h3>Edge<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_z\/im\/h2\/_zimh2thj4w5t2o_ounushbk94m.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 44.17763.771.0<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 25.595959595959595 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 10.12639235162126 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 28 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 25.862596938775525 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 10.123711255512573 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 27.027099999999336 \u043c\u0441  <\/div>\n<\/div>\n<h3>Firefox<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bm\/pn\/bs\/bmpnbsvv3esgusduj0djwdvazg4.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 71.0<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.6914893617021276 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.6018870280772611 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 2 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.7865168539325842 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.6442818510935484 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 2 \u043c\u0441  <\/div>\n<\/div>\n<h3>Chrome<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ig\/my\/wf\/igmywf_jvwphlqdqm9qac2evy64.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 79.0.3945.88<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 4.787878787878788, \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.7557553886872682 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 5 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 4.783989898979516 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.6483716900974945 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 4.750000000058208 \u043c\u0441  <\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u043a\u0442\u043e-\u0442\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 HTML \u0430\u0443\u0434\u0438\u043e\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 WebAudio \u043f\u0440\u0438\u0448\u043b\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u2013 \u043e\u043d\u0438 \u0432\u0441\u0435 \u0437\u0432\u0443\u0447\u0430\u043b\u0438, \u0431\u0443\u0434\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u044c\u044f\u043d\u043e, \u0440\u0430\u0441\u0445\u043b\u044f\u0431\u0430\u043d\u043d\u043e. \u041a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <code>setTimeout<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u043a\u0432\u0435\u043d\u0441\u043e\u0440\u0430. <\/p>\n<p>  \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 WebAudio API, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0432\u0435\u0441 \u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0430\u0436 \u0434\u043e 0.02 \u043c\u0441\u0435\u043a (\u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0446\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 44100Hz). \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0432\u0443\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0447\u0435\u043c <code>setTimeout<\/code>:<\/p>\n<pre><code class=\"javascript\">source.start(when);<\/code><\/pre>\n<p>  \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043b\u044e\u0431\u043e\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0430\u0443\u0434\u0438\u043e\u0441\u0435\u043c\u043f\u043b\u0430 \u2013 \u00ab\u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435\u00bb. \u041f\u0440\u043e\u0441\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u00ab\u043d\u0435 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043e\u00bb, \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u00ab\u0434\u043e \u0441\u0435\u0439\u0447\u0430\u0441\u00bb.<\/p>\n<pre><code class=\"javascript\">source.start(audioCtx.currentTime);<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e-\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u043c\u0443\u0437\u044b\u043a\u0435 \u00ab\u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438\u00bb<\/b><\/p>\n<div class=\"spoiler_text\">\u0415\u0441\u043b\u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e-\u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u043c\u0435\u043b\u043e\u0434\u0438\u044e \u0438\u0437 \u043d\u043e\u0442 \u2013 \u0442\u043e \u044d\u0442\u0438 \u043d\u043e\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u0422\u043e\u0433\u0434\u0430, \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0432\u0441\u0435 \u043d\u0435 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043d\u0435\u0440\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u0432, \u043c\u0435\u043b\u043e\u0434\u0438\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0440\u043e\u0432\u043d\u043e.<\/p>\n<p>  \u0418\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u043b\u043e\u0434\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u00ab\u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d\u0430\u00bb \u043d\u0435 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435.   <\/div>\n<\/div>\n<h2>One timer to rule them all<\/h2>\n<p>  \u0420\u0430\u0437 \u0443\u0436 <code>audioCtx.currentTime<\/code> \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0438 \u0442\u043e\u0447\u043d\u044b\u0439, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435\u0441\u0442.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430: \u0437\u0430\u043c\u0435\u0440 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0446\u0438\u043a\u043b\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">function measureTimesInLoop(length) {   const d = new Array(length);   const p = new Array(length);   const a = new Array(length);   for (let i = 0; i &lt; length; i++) {     d[i] = Date.now();     p[i] = performance.now();     a[i] = audioCtx.currentTime * 1000;   }   return { d, p, a } }<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lt\/rr\/xo\/ltrrxo5m-cfdsf7kpwy_vm0d4nu.png\" align=\"left\"><code>Date.now()<\/code><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hp\/h-\/w3\/hph-w3yafyxorpopqiksdnd6j5g.png\" align=\"left\"><code>performance.now()<\/code><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xo\/or\/r9\/xoorr9ldh_oivoxxvbxj8yozwqc.png\" align=\"left\"><code>audioCtx.currentTime<\/code><\/p>\n<h3>Edge<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rt\/xx\/u0\/rtxxu0ckburybooxuw93uiya7-s.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 44.17763.771.0<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.037037037037037 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.6166609846299806 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.5447103117505993 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.4390514285320851 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1.5015000000000782 \u043c\u0441<\/p>\n<h3>audioCtx.currentTime<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 2.955751134714949 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.6193645611529503 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 2.902507781982422 \u043c\u0441<\/p><\/div>\n<\/div>\n<h3>Firefox<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rr\/v6\/ws\/rrv6wsi1tmnpdb8yf7y6wmfvyo8.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 71.0<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.005128205128205 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.12392867665225249 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.00513698630137 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.07148844433269844 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1 \u043c\u0441<\/p>\n<h3>audioCtx.currentTime<\/h3>\n<p>\u0412 \u0441\u0438\u0445\u043d\u0440\u043e\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 Firefox \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0443\u0434\u0438\u043e\u0442\u0430\u0439\u043c\u0435\u0440\u0430<\/p><\/div>\n<\/div>\n<h3>Chrome<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yx\/wx\/rk\/yxwxrkmxhv3yzxzpzckvfhouz6y.png\">  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 79.0.3945.88<\/p>\n<h3>Date.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.0207612456747406 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.49870223457982504 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1 \u043c\u0441<\/p>\n<h3>performance.now()<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 0.005414502034674972 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 0.027441293974958335 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 0.004999999873689376 \u043c\u0441<\/p>\n<h3>audioCtx.currentTime<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 3.0877599266656963 \u043c\u0441<br \/>  \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430, RMS: 1.1445555956407658 \u043c\u0441<br \/>  \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 2.9024943310650997 \u043c\u0441<\/p><\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0413\u0440\u0430\u0444\u0438\u043a\u0438 \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430: \u0437\u0430\u043c\u0435\u0440 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435<\/b><\/p>\n<div class=\"spoiler_text\"> \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0435 100 \u043c\u0441:<\/p>\n<pre><code class=\"javascript\">function pause(duration) {     return new Promise((resolve) =&gt; {         setInterval(() =&gt; {           resolve();         }, duration);     });   }    async function measureTimesInAsyncLoop(length) {     const d = new Array(length);     const p = new Array(length);     const a = new Array(length);     for (let i = 0; i &lt; length; i++) {       d[i] = Date.now();       p[i] = performance.now();       await pause(1);     }     return { d, p }   }<\/code><\/pre>\n<p>   <\/div>\n<\/div>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lt\/rr\/xo\/ltrrxo5m-cfdsf7kpwy_vm0d4nu.png\" align=\"left\"><code>Date.now()<\/code><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hp\/h-\/w3\/hph-w3yafyxorpopqiksdnd6j5g.png\" align=\"left\"><code>performance.now()<\/code><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xo\/or\/r9\/xoorr9ldh_oivoxxvbxj8yozwqc.png\" align=\"left\"><code>audioCtx.currentTime<\/code><\/p>\n<h3>Edge<\/h3>\n<p>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3o\/sz\/az\/3oszazaq71kxfdaftgn6v3z23xe.png\">   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\"> \u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 44.17763.771.0<\/p>\n<h3>Date.now():<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 24.505050505050505 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 11.513166584195204 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 26 \u043c\u0441<\/p>\n<h3>performance.now():<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 24.50935757575754 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 11.679091435527388 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 25.525499999999738 \u043c\u0441<\/p>\n<h3>audioCtx.currentTime:<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 24.76005164944396 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 11.311571546205316 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 26.121139526367187 \u043c\u0441<\/p><\/div>\n<\/div>\n<h3>Firefox<\/h3>\n<p>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wf\/4n\/jn\/wf4njn3z7u9uoxluprufhlbctai.png\">   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\"> \u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 71.0<\/p>\n<h3>Date.now():<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.6875 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 0.6663410663216448 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 2 \u043c\u0441<\/p>\n<h3>performance.now():<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 1.7234042553191489 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 0.6588877688171075 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 2 \u043c\u0441<\/p>\n<h3>audioCtx.currentTime:<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 10.158730158730123 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1.4512471655330046 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 8.707482993195299 \u043c\u0441<\/p><\/div>\n<\/div>\n<h3>Chrome<\/h3>\n<p>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_s\/hd\/uh\/_shduhzpetwube_gn6kxmwyobiu.png\">   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\"> \u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430: 79.0.3945.88<\/p>\n<h3>Date.now():<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 4.585858585858586 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 0.9102125516015199 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 5 \u043c\u0441<\/p>\n<h3>performance.now():<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 4.59242424242095 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 0.719936993603155 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 4.605000001902226 \u043c\u0441<\/p>\n<h3>audioCtx.currentTime:<\/h3>\n<p>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: 10.12648022171832 \u043c\u0441<br \/>   \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 1.4508887886499262 \u043c\u0441<br \/>   \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430: 8.707482993197118 \u043c\u0441<\/p><\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0427\u0442\u043e\u0436, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u00ab\u0421\u043d\u0430\u0440\u0443\u0436\u0438\u00bb \u044d\u0442\u043e\u0442 \u0442\u0430\u0439\u043c\u0435\u0440 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u043d\u0435\u0442\u043e\u0447\u043d\u044b\u043c. Firefox \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430. \u0410 \u0432 \u0446\u0435\u043b\u043e\u043c: \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 3 \u043c\u0441 \u0438 \u0445\u0443\u0436\u0435 \u0438 \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u0439 \u0434\u0436\u0438\u0442\u0442\u0435\u0440. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>audioCtx.currentTime<\/code> \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u043a\u043e\u043b\u044c\u0446\u0435\u0432\u043e\u043c \u0431\u0443\u0444\u0435\u0440\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0430\u0443\u0434\u0438\u043e\u043a\u0430\u0440\u0442\u044b. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0435\u0449\u0451 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u0418 \u0447\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c? \u0412\u0435\u0434\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u0442\u043e\u0447\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 javascript \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435, \u0438 \u0430\u0443\u0434\u0438\u043e\u0442\u0430\u0439\u043c\u0435\u0440 \u0434\u043b\u044f \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439! <\/p>\n<p>  \u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c:<\/p>\n<ul>\n<li>\u041a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 <code>audioCtx.currentTime<\/code> \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u043c <code>performance.now()<\/code> \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435.<\/li>\n<li>\u0418 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 <code>performance.now()<\/code> c <code>performance.now()<\/code> \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u043c.<\/li>\n<\/ul>\n<h2> \u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b, \u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/f1\/ph\/o9\/f1pho9gss4d40786nszfeicwrog.png\" align=\"right\">\u0412\u043e\u043e\u0431\u0449\u0435, \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f: \u041c\u043e\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u0432\u0430 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 A \u0438 B, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0443\u0431\u043b\u0435\u043d \u0438 \u0437\u0430\u0448\u0443\u043c\u043b\u0435\u043d (A&#8217; = A + err<sub>A<\/sub>; B&#8217; = B + err<sub>B<\/sub>) \u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u0440\u0438\u0433\u043e\u0434\u0435\u043d \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435. \u041d\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0443 d \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043d\u0435\u0437\u0430\u0448\u0443\u043c\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u00f3\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u0430\u043c\u0438 \u2013 \u044d\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430, \u043f\u0440\u043e\u0432\u0435\u0434\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f n \u0440\u0430\u0437, \u043c\u044b \u0432 n \u0440\u0430\u0437 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f err. \u0415\u0441\u043b\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0447\u0430\u0441\u044b \u0438\u0434\u0443\u0442 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e.<\/p>\n<h2>\u0414\u0430 \u043d\u0435 \u0432\u044b\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b<\/h2>\n<p>  \u041f\u043b\u043e\u0445\u0430\u044f \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0435\u0442, \u043d\u0435 \u0438\u0434\u0443\u0442 \u043e\u043d\u0438 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0418 \u044f \u0433\u043e\u0432\u043e\u0440\u044e \u043d\u0435 \u043e \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u0447\u0430\u0441\u043e\u0432 \u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u2014 \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e. \u0427\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e: <code>audioCtx.currentTime<\/code> \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441 <code>performance.now()<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u044c, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430, \u043f\u0440\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435, \u0430\u0443\u0434\u0438\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u0440\u043e\u0433\u043b\u043e\u0442\u0438\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u0443\u0441\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0438, (\u0432\u043e\u043f\u0440\u0435\u043a\u0438 \u043f\u0440\u0438\u0440\u043e\u0434\u0435 \u043a\u043e\u043b\u044c\u0446\u0435\u0432\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430) \u0430\u0443\u0434\u0438\u043e\u0432\u0440\u0435\u043c\u044f \u0441\u0434\u0432\u0438\u043d\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u0440\u0435\u0434\u043a\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u044d\u0442\u043e \u043c\u0430\u043b\u043e \u043a\u043e\u0433\u043e \u0437\u0430\u0431\u043e\u0442\u0438\u0442: \u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0434\u0432\u0430 youtube \u0432\u0438\u0434\u0435\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u2014 \u043d\u0435 \u0444\u0430\u043a\u0442 \u0447\u0442\u043e \u043e\u043d\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0430\u0442 \u0438\u0433\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0418 \u0434\u0435\u043b\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u0432 \u0440\u0435\u043a\u043b\u0430\u043c\u0435.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e <i>\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e<\/i> \u043f\u0435\u0440\u0435\u0441\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0441\u0435 \u0447\u0430\u0441\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u2014 \u043a\u0430\u043a \u043e\u043f\u043e\u0440\u043d\u043e\u0435. \u0418 \u0442\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f trade-off \u0432 \u0442\u043e\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f: \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u0442\u0435\u043c \u0442\u043e\u0447\u043d\u0435\u0435, \u043d\u043e \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0448\u0430\u043d\u0441 \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u043e\u043a\u043d\u043e, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u043f\u0430\u043b \u0440\u0435\u0437\u043a\u0438\u0439 \u0441\u043a\u0430\u0447\u043e\u043a \u0432 <code>audioCtx.currentTime<\/code>. \u0422\u043e\u0433\u0434\u0430, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0438\u043d\u0443\u0442\u043d\u043e\u0435 \u043e\u043a\u043d\u043e, \u0442\u043e \u0432\u0441\u044e \u043c\u0438\u043d\u0443\u0442\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u0435\u0442\u044c \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u043d\u0443\u044e d. \u0412\u044b\u0431\u043e\u0440 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u0448\u0438\u0440\u043e\u043a: <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%AD%D0%BA%D1%81%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%86%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B5_%D1%81%D0%B3%D0%BB%D0%B0%D0%B6%D0%B8%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\" rel=\"nofollow\">\u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439<\/a>, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9C%D0%B5%D0%B4%D0%B8%D0%B0%D0%BD%D0%B0_(%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0)\" rel=\"nofollow\">\u043c\u0435\u0434\u0438\u0430\u043d\u043d\u044b\u0439<\/a>, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A4%D0%B8%D0%BB%D1%8C%D1%82%D1%80_%D0%9A%D0%B0%D0%BB%D0%BC%D0%B0%D0%BD%D0%B0\" rel=\"nofollow\">\u0444\u0438\u043b\u044c\u0442\u0440 \u041a\u0430\u043b\u043c\u0430\u043d\u0430<\/a>, \u0438 \u0442.\u043f. \u041d\u043e \u044d\u0442\u043e\u0442 trade-off \u0435\u0441\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<h2>\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u00f3\u0435 \u043e\u043a\u043d\u043e<\/h2>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0438\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 <code>audioCtx.currentTime<\/code> \u0441 <code>performance.now()<\/code>, \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043c\u0435\u0448\u0430\u0442\u044c UI, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0432 10 \u043c\u0441. <br \/>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f err=errA + errB = 1+3 = 4 \u043c\u0441<br \/>  \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0451 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0434\u043e 0.4 \u043c\u0441, \u0430 \u0437\u0430 10 \u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043e 0.04 \u043c\u0441. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043e\u043a\u043d\u043e\u043c \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442: 1 \u2014 10 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u0441\u0435\u0442\u0438, \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0443\u0436\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0441\u043e\u043c\u044b\u0435, \u043d\u043e \u0437\u0430\u0442\u043e \u0440\u0435\u0437\u043a\u043e\u0433\u043e \u0441\u043a\u0430\u0447\u043a\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043b\u0430\u0433\u0430\u044e\u0449\u0438\u043c <code>audioCtx.currentTime<\/code>. \u0418 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443. \u0412\u0435\u0434\u044c err \u0434\u043b\u044f \u043f\u0438\u043d\u0433\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438 500 \u043c\u0441. \u0410 \u0441\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u0447\u0430\u0441\u0442\u043e.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f. \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u044f \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u00ab\u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043b \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u043e\u0432\u0443\u00bb. \u041d\u043e \u0430 \u0440\u0430\u043c\u043a\u0430\u0445 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430\u0445, \u0441\u0447\u0438\u0442\u0430\u044e \u0441\u0432\u043e\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u044b\u043c.<\/p>\n<p>  \u0418 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443 \u043c\u0435\u043d\u044f. \u0412\u0441\u0451 \u0442\u0430\u043a\u0438 \u043d\u043e\u0432\u044b\u0439 \u0433\u043e\u0434.<\/p>\n<h2>\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h2>\n<p>  Disclaimer: \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043f\u0438\u0430\u0440 \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435\u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439 opensource pet-\u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u043e\u0431\u0435\u0449\u0430\u044e \u043d\u0438\u043a\u043e\u0433\u0434\u0430: \u043d\u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u043a\u043b\u0430\u043c\u0443, \u043d\u0438 \u043a\u0430\u043a-\u043b\u0438\u0431\u043e \u0435\u0449\u0451 \u0437\u0430\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c. \u041d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u044f \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u043d\u0435\u0433 \u043f\u043e\u0434\u043d\u044f\u043b \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0445\u0430\u0431\u0440\u0430\u044d\u0444\u0444\u0435\u043a\u0442. \u041f\u043e-\u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0434\u043e\u0431\u0440\u044b\u0435 \u043b\u044e\u0434\u0438, \u043d\u0435 \u043b\u043e\u043c\u0430\u0439\u0442\u0435 \u043c\u0435\u043d\u044f \u0438 \u043d\u0435 \u0434\u0434\u043e\u0441\u044c\u0442\u0435. \u042d\u0442\u043e \u0432\u0441\u0451 \u0447\u0438\u0441\u0442\u043e \u043f\u043e-\u0444\u0430\u043d\u0443.<\/p>\n<p>  \u0421 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u043c \u043d\u043e\u0432\u044b\u043c \u0433\u043e\u0434\u043e\u043c, \u0425\u0430\u0431\u0440!<\/p>\n<hr>\n<p>  <\/p>\n<h3><a href=\"http:\/\/snowtime.fun\" rel=\"nofollow\">snowtime.fun<\/a><\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0440\u0443\u0447\u043a\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u043c\u0443\u0437\u044b\u043a\u043e\u0439 \u0438 \u0430\u0443\u0434\u0438\u043e\u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430, \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0430\u0441\u0442\u0438\u0446 100%.<\/p>\n<p>  \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 WebAudio \u0438 WebGL.  <\/p>\n<hr>\n<p>  \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: <a href=\"https:\/\/bitbucket.org\/barkalov\/snowtime.fun\/src\" rel=\"nofollow\">bitbucket<\/a><br \/>  \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 <a href=\"http:\/\/www.freepik.com\" rel=\"nofollow\">macrovector \/ Freepik<\/a><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/482168\/\"> https:\/\/habr.com\/ru\/post\/482168\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482168\/\">\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u043e\u0432. \u0418 \u043d\u0430\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0433\u0438\u0440\u043b\u044f\u043d\u0434\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043c\u043e\u0440\u0433\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0418\u043b\u0438, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0446\u0432\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u0443\u043c\u043d\u043e\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443. \u0418 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u2013 \u0432\u0435\u0434\u044c \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u044b, \u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u044b. \u0412\u0441\u0451 \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yo\/1c\/a8\/yo1ca85ahnnxg_5crc1hh84n9ng.jpeg\"><\/p>\n<p>  \u0418, \u0440\u0430\u0437 \u0443\u0436 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0451 \u0438 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435. \u0412\u0435\u0434\u044c \u0435\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0432\u0443\u043a\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e \u0437\u0432\u0443\u0447\u0438\u0442 \u043e\u0434\u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u043a\u0430\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430.<\/p>\n<hr>\n<p><i>\u0421 \u0447\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Web Audio \u0438 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439\u043d\u044b\u0445 \u0447\u0430\u0441\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 javascript-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u00ab\u0447\u0430\u0441\u043e\u0432\u00bb \u0435\u0441\u0442\u044c \u0432 javasctipt (\u0442\u0440\u0438!) \u0438 \u0437\u0430\u0447\u0435\u043c \u0432\u0441\u0435 \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"http:\/\/snowtime.fun\" rel=\"nofollow\">\u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/a> \u0434\u043b\u044f node.js \u2013 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/i><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-296544","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=296544"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296544\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}