APIs of mine
MIT License
APIs of mine
Name of function | Average responce time (ms) |
---|---|
Time difference | 32.7 |
UNIX time | 241.4 |
Ping | 788.83 |
The time API is availible at https://trnck.dev/time
Name | Description | Example |
---|---|---|
ts | Current client timestamp (in ms) | 1606995302000 |
{
"status":"success",
"result":{
"s":135,
"ms":135022,
"unix":1606995437022
}
}
const timestamp = Date.now();
fetch(`https://trnck.dev/time?ts=${timestamp}`).then(f => f.json()).then(f => {
const nowstamp = Date.now()
console.table({adjusted: Math.round(f.result.ms - (nowstamp - timestamp) / 2), raw: f.result.ms})
})
Due to the One Way Latency problem, there is no way to calculate the exact time that passes between the client and the server.
The ping API is availible at https://api.trnck.dev/ping
An API to ping a URL or IP adress, accepts any URL
Name | Description | Example |
---|---|---|
url | URL to ping | https://taskord.com |
{
"status": "success",
"result": {
"miliseconds": 404,
"code": 200
}
}
A simle API for making the server respond with a certain status code
Name | Type | Description | Example |
---|---|---|---|
code | int | Status code to mock | 418 |