This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<chrono> | |
int main() | |
{ | |
auto start = std::chrono::system_clock::now(); | |
auto end = std::chrono::system_clock::now(); | |
while((std::chrono::duration_cast<std::chrono::seconds>(end - start).count() != 2)) | |
{ | |
end = std::chrono::system_clock::now(); | |
cout<<"Time is"<<std::chrono::duration_cast<std::chrono::seconds>(end - start).count()<<" second"<<endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAccessToken(code) { | |
var authOptions = {/**/}; | |
return new Promise(function(resolve, reject) { | |
request.post(authOptions, function(error, response, body) { | |
if (!error && response.statusCode === 200) { | |
var access_token = body.access_token, | |
refresh_token = body.refresh_token; |