Answers for "wait()"

10

wait javascript

wait(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
 }
Posted by: Guest on June-19-2020
1

c fork wait for child

int main(){
    pid_t pid = fork();
    if (pid == 0) {
        printf("HC: hello from child\n");
        exit(17);
    } else {
        int child_status;
        printf("HP: hello from parent\n");
        waitpid(pid, &child_status, 0); // Waits for child to end
        printf("CT: child result %d\n", WEXITSTATUS(child_status));
    }
    printf("Bye\n");
    return 0;
}
Posted by: Guest on December-02-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language