Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Import
- {
- private static object ImportLock = new object();
- private static DateTime LastImport = DateTime.MinValue;
- public static ImportInfo Import()
- {
- lock (ImportLock)
- {
- if (DateTime.Now.AddSeconds(-10) < LastImport)
- {
- return "no import - time lock";
- }
- LastImport = DateTime.Now;
- return "imported";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement