async function foo() {
try {
const content = await fs.readFile("config.json", "utf-8");
const obj = JSON.parse(content);
console.log(obj);
} catch(error) {
console.error(error);
};
}
$("#but").click(function...
- это фигня. Если enter нажать, то никакого клика не будет, а форма отправится. Замените на $('myform').on('submit', function...)
const std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
my_sort();
const std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count();
#include <iostream>
#include <chrono>
int main()
{
using Time = std::chrono::time_point<std::chrono::high_resolution_clock>;
using Diff = std::chrono::milliseconds;
Time t1 = std::chrono::high_resolution_clock::now();
int i;
std::cin >> i;
Time t2 = std::chrono::high_resolution_clock::now();
Diff diff = std::chrono::duration_cast<Diff>(t2 - t1);
std::cout << diff.count() << " ms" << std::endl;
return 0;
}