Jump to content

does anyone know how i can add a 5 second delay to this code? 

 

function getPrice(id)
{
  try
  {
    var api = "http://services.runescape.com/m=itemdb_rs/api/graph/";
    var i = JSON.parse(UrlFetchApp.fetch(api + id + ".json"))["daily"];
    var e = Object.keys(i).sort().reverse()[0];
    return i[e];
  }
  catch(err)
  {
    return -1;
  }
}    

 

kind regards 

Current Build : 

 
CASE: Fractal Design R4 w/Window CPU: Intel 4930K,  RAM: 16GB Ripjaws Z 2133Mhz  Cooling: H100i  MotherBoard: Asus P9x79 Pro , PSU: CS750M   Storage: 2x Samsung 840 Pro 256Gb , 1Tb Seagate Barracuda, 500GB WD Black,  Graphics: Gigabyte GTX 780 Windforce 3GB,  Monitors: AOC G2460PG ( G sync monitor), Edge10 24" 1080p , 24" 1680*1020p monitor ( LCD)  Microphone: Blue Yeti  Keyboard: Cougar 700k  Phone: Samsung Note 3  Headphones: Sennheiser HD598

Laptop:

 CPU: 
4710MQ  Ram: 8GB 1600MHz Storage:120Gb 840 Evo + 1Tb 5400Rpm HDD  Graphics: GTX 850M 2GB   Screen: 1080p IPS  
Link to comment
https://linustechtips.com/topic/562009-adding-a-delay-to-this-code/
Share on other sites

Link to post
Share on other sites

well idk what language is that, but look for some "time" or "wait" function on google for the language

NEW PC build: Blank Heaven   minimalist white and black PC     Old S340 build log "White Heaven"        The "LIGHTCANON" flashlight build log        Project AntiRoll (prototype)        Custom speaker project

Spoiler

Ryzen 3950X | AMD Vega Frontier Edition | ASUS X570 Pro WS | Corsair Vengeance LPX 64GB | NZXT H500 | Seasonic Prime Fanless TX-700 | Custom loop | Coolermaster SK630 White | Logitech MX Master 2S | Samsung 980 Pro 1TB + 970 Pro 512GB | Samsung 58" 4k TV | Scarlett 2i4 | 2x AT2020

 

Link to post
Share on other sites

Is that JavaScript?

 

Try 


setTimeout(function() { your_func(); }, 5000);

 

Spoiler

I7 4790K @4.5 Ghz 1.294V

VALIDATION, MSI Z97 Gaming 7, 24GB DDR3 1600, Asus Strix 1070 8GB OC@ 2.2Ghz, Corsair graphite series 760T (Black), Cooler master V850, NH-D15 w/LNA ,1TB Samsung 850 Evo,  480GB Sandisk Ultra II SSD, 3TB Seagate Barracuda x 3, 1 TB WD Passport (Backup drive), 2 TB WD Passport (Backup Drive 2),  Windows 10 Pro x64 (uhg), Logitech G900 Chaos (Main), Steelseries Rival (FADE) (Courtesy of Edzel Yago, Thanks Ed), Steelsieres Rival 300 Hyperbeast Special Edition, Coolermaster Quickfire TKL (MX Blue), Razer Blackwidow Tournament edition (Greens).  Audio: Sennheiser HD598 SE, Edifier S1000DB, AudioEngine D1 DAC; Yamaha MG06X Mixer & AudioTechnica AT2020.

 

Phones; Daily drivers: Nexus 6P 64GB/iPhone 6 (Music), Apple Watch, Apple AirPods.

Laptop: 2015 Macbook Pro 13, 8GB of RAM, 2.7Ghz i5, 240GB Apple SSD. 

 

Spoiler

Plex Server: i7 3770, Gigabyte Board, 16GB DDR3 1600, Asus Strix GTX 1050ti 4GB, 120GB SSD Boot Drive, 8 x 3TB Seagate Barracuda, Rosewill RSV-R4000 With 2 Rosewill Hot Swap 4x Backplane Bays, 1050 Watt Corsair HX Series PSU,Hyper T2, Windows 10 Pro 

 

I also do Youtube, check me out!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×