Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
How can I add a sleep/delay in every 100 records to w2ui grid?

I need a way to add records in a certain cycle(in each cycle I want to add 100 records) to the w2ui grid. However, I do not want to use a for a loop. Instead, I would like to add sleep(or one of its alternatives) in every 100 records. Otherwise, 1000 records are printed at the same time which is not useful for me. One part of my current code is like this:

...
for (let i = 0; i < Object.keys(msgs[j].internal_list).length; i++) {
                    record_entries = {
                        recid: msgs[j].chnl_name + "_" + msgs[j].msg_name + "_" + idx_msgs,
                        chnl_name: msgs[j].chnl_name,
                        msg_name: msgs[j].msg_name,
                        msg_id: msgs[j].msg_id,
                        msg_type: msgs[j].msg_type,
                        can_frame_time: msgs[j].internal_list[i].t,
                        msg_dir: msgs[j].internal_list[i].msg_dir,
                        interval: msgs[j].internal_list[i].interval,
                        min_interval: msgs[j].internal_list[i].min_interval,
                        max_interval: msgs[j].internal_list[i].max_interval,
                        raw_data: msgs[j].internal_list[i].raw_data
                    }
                    if (((idx_msgs % 100) === 0) || ((j === msgs.length - 1) &&
                        (i === Object.keys(msgs[j].internal_list).length - 1) && (idx_msgs >= nums_traces)))
                    {
                        w2ui['can_frame_grid'].add(record_entries);
                        // w2ui['can_frame_grid'].sort('can_frame_time', 'asc');
                    }
                    else
                    {
                        records[idx_msgs] = record_entries;
                    }
                    idx_msgs += 1;
                }
...
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!