Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizing the overhead of the sleep command #41

Closed
ko1nksm opened this issue Dec 23, 2021 · 5 comments
Closed

Optimizing the overhead of the sleep command #41

ko1nksm opened this issue Dec 23, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@ko1nksm
Copy link
Contributor

ko1nksm commented Dec 23, 2021

As with any other command, there is an overhead in executing the sleep command.

# FALL_SPEED_LEVEL_15=0.007
$ time sh -c 'i=0; while [ $i -lt 1000 ]; do i=$((i+1)); sleep 0.007 > /dev/null; done'

real	0m11.345s
user	0m0.911s
sys	0m1.748s

I would like to eliminate this. I suspect that measuring the execution time of the sleep command will improve this issue. I don't know if this will work, but I am going to give it a try.

@ContentsViewer
Copy link
Owner

I impressed for your help. Very thanks!

@ko1nksm ko1nksm changed the title Optimizing overhead by running the sleep command Optimizing the overhead of the sleep command Dec 23, 2021
@ContentsViewer
Copy link
Owner

I will implement the line clear effect and lockdown effect.

@ko1nksm
Copy link
Contributor Author

ko1nksm commented Dec 23, 2021

I'm not sure how useful this feature will be, so I plan to implement an option to change the sleep method.

@ContentsViewer
Copy link
Owner

OK!

@ko1nksm
Copy link
Contributor Author

ko1nksm commented Jan 9, 2022

I'm thinking of doing this in my own repository, so I'd like to close it from here. When it is done, I will create a PR as before. It may take some time.

@ko1nksm ko1nksm closed this as completed Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants