I am writing a script for measuring voltage frequency characteristic of DUT which has delay time by Analog Discovery 2. Then I want to use the java script function "sleep()", but Waveforms script does not accept "sleep()" function. So please teach me the substitution of "sleep()" function for Waveforms script. For example I want to wait 1 sec for each frequency.
By the way I wrote the code below, but it seems to waste CPU resource. So I do not want to use this code.
Question
AlexMark6
I am writing a script for measuring voltage frequency characteristic of DUT which has delay time by Analog Discovery 2. Then I want to use the java script function "sleep()", but Waveforms script does not accept "sleep()" function. So please teach me the substitution of "sleep()" function for Waveforms script. For example I want to wait 1 sec for each frequency.
By the way I wrote the code below, but it seems to waste CPU resource. So I do not want to use this code.
const d1 = new Date();
while (true) {
const d2 = new Date();
if (d2 - d1 > 1000) {
break;
}
}
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now