Also,ich glaube die ganze Sache ist nicht ganz so einfach wie du hoffst.
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
| using System.Runtime.InteropServices;
SystemTime st = new SystemTime(); SystemTimeFuncs.GetLocalTime(st);
public class SystemTimeFuncs { [DllImport("Kernel32.dll")] public static extern void GetLocalTime([In, Out] SystemTime st); [DllImport("Kernel32.dll")] public static extern bool SetLocalTime([In, Out] SystemTime st); }
[StructLayout(LayoutKind.Sequential)] public class SystemTime { public ushort wYear; public ushort wMonth; public ushort wDayOfWeek; public ushort wDay; public ushort wHour; public ushort wMinute; public ushort wSecond; public ushort wMilliseconds; } |
Das müsste der Code zum bekommen der aktuellen SystemZeit sein.
und nun zum ausschalten der CPU-schlacht.
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8:
| using System.Threading;
Thread.Sleep(n);
Thread.Sleep((60-st.wSecond)*1000); |
Hoffe es funzt und du schreibst mir, wenn du fragen hast.
MfG
Carsten
PS.: Wähle das nächste mal bitte ein passenderes Thema.