Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions JS/httpBinExcercise/httpExec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//parallel run excercise
//for get uuid
async function getUuid(){
console.time("getUuid Time")
const response = await fetch("https://httpbin.org/uuid")
console.timeEnd("getUuid Time")
const uuid = await response.json();
return uuid.uuid;
}

// getdelay
async function delay(delayData){
console.time("Delay Time");
const response = await fetch("https://httpbin.org/delay/5")
console.timeEnd("Delay Time");
const delay = await response.json();
return delay;
}

//post
async function postAnything(uuid){
const response = await fetch(`https://httpbin.org/anything`, {
method: "POST",
body: uuid,
});
const data = await response.json()
return data
}

async function main() {
console.time("TotalTime:")

let uuid = getUuid();
let delayRes = delay();
console.time("Post time:")
let anything = await postAnything(await uuid);
console.log("data", anything.data);
console.timeEnd("Post time:")

await delayRes
console.timeEnd("TotalTime:")
}
main();

1 change: 1 addition & 0 deletions JS/node_modules/.bin/colors

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions JS/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions JS/node_modules/colors-cli/.github/FUNDING.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions JS/node_modules/colors-cli/.github/workflows/ci.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

194 changes: 194 additions & 0 deletions JS/node_modules/colors-cli/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading