Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Coding :)

Omer Hijazi omerhijazi404

💭
Coding :)
View GitHub Profile
@omerhijazi404
omerhijazi404 / Wait.cs
Created Sep 16, 2020
An alternative for the await command, can be used in any function.
View Wait.cs
// Main Function
public void Wait(int TimeToWait) {
int bob = DateTime.Now.Millisecond + TimeToWait;
for (int bib = DateTime.Now.Millisecond; bob != bib; bib = DateTime.Now.Millisecond) {}
}
// Example by Instance
public class Wait {
public void Wait(int Seconds) {
int bob = DateTime.Now.Second + Seconds;
View include.html
<html>
<head>
<title>string.includes() alternative</title>
<script>
// Alternative for string.includes() method,
// which doesn't work in Internet Explorer.
// This uses the string.search() method,
// which has two advantages;
// One, that it works in all browsers as it is part of ECMAScript 1,
// Two, it supports RegEx.
You can’t perform that action at this time.